@@ -16,6 +16,7 @@ import {
1616 getAccessibleText ,
1717 doNavigationClose ,
1818 waitForToast ,
19+ ToastId ,
1920} from '../helpers/actions' ;
2021import { electrumHost , electrumPort } from '../helpers/constants' ;
2122import { launchFreshApp , reinstallApp } from '../helpers/setup' ;
@@ -389,12 +390,14 @@ describe('@settings - Settings', () => {
389390 expectedHost : electrumHost ,
390391 expectedPort : electrumPort . toString ( ) ,
391392 expectedProtocol : 'TCP' ,
393+ expectedToastMessage : 'ElectrumUpdatedToast' ,
392394 } ;
393395 const umbrel2 = {
394396 url : `${ electrumHost } :${ electrumPort } :s` ,
395397 expectedHost : electrumHost ,
396398 expectedPort : electrumPort . toString ( ) ,
397399 expectedProtocol : 'TLS' ,
400+ expectedToastMessage : driver . isAndroid ? 'ElectrumErrorToast' : 'ElectrumUpdatedToast' ,
398401 } ;
399402
400403 // HTTP URL
@@ -403,17 +406,20 @@ describe('@settings - Settings', () => {
403406 expectedHost : electrumHost ,
404407 expectedPort : electrumPort . toString ( ) ,
405408 expectedProtocol : 'TCP' ,
409+ expectedToastMessage : 'ElectrumUpdatedToast' ,
406410 } ;
407411 const http2 = {
408412 url : `https://${ electrumHost } :${ electrumPort } ` ,
409413 expectedHost : electrumHost ,
410414 expectedPort : electrumPort . toString ( ) ,
411415 expectedProtocol : 'TLS' ,
416+ expectedToastMessage : driver . isAndroid ? 'ElectrumErrorToast' : 'ElectrumUpdatedToast' ,
412417 } ;
413418
414419 const conns = [ umbrel1 , umbrel2 , http1 , http2 ] ;
415420 let i = 0 ;
416421 for ( const conn of conns ) {
422+ console . info ( `Testing Electrum connection format #${ i + 1 } : ${ conn . url } ` ) ;
417423 await sleep ( 1000 ) ;
418424 await tap ( 'NavigationAction' ) ;
419425 // on the first time we need to accept the notifications permission dialog to use camera
@@ -423,7 +429,7 @@ describe('@settings - Settings', () => {
423429 await tap ( 'ScanPrompt' ) ;
424430 await typeText ( 'QRInput' , conn . url ) ;
425431 await tap ( 'DialogConfirm' ) ;
426- await waitForToast ( 'ElectrumUpdatedToast' ) ;
432+ await waitForToast ( conn . expectedToastMessage as ToastId ) ;
427433 await expect ( await elementById ( 'HostInput' ) ) . toHaveText ( conn . expectedHost ) ;
428434 expect ( await elementById ( 'PortInput' ) ) . toHaveText ( conn . expectedPort ) ;
429435 // await expectTextWithin('ElectrumProtocol', conn.expectedProtocol);
@@ -434,7 +440,9 @@ describe('@settings - Settings', () => {
434440 await elementById ( 'ResetToDefault' ) . waitForEnabled ( ) ;
435441 await tap ( 'ResetToDefault' ) ;
436442 await tap ( 'ConnectToHost' ) ;
437- await waitForToast ( 'ElectrumUpdatedToast' , { waitToDisappear : false } ) ;
443+ if ( driver . isIOS ) {
444+ await waitForToast ( 'ElectrumUpdatedToast' , { waitToDisappear : false } ) ;
445+ }
438446 await elementById ( 'Connected' ) . waitForDisplayed ( ) ;
439447 await sleep ( 1000 ) ;
440448 } ) ;
0 commit comments