@@ -14,8 +14,8 @@ import {
1414 confirmInputOnKeyboard ,
1515 multiTap ,
1616 getAccessibleText ,
17- expectText ,
1817 doNavigationClose ,
18+ waitForToast ,
1919} from '../helpers/actions' ;
2020import { electrumHost , electrumPort } from '../helpers/constants' ;
2121import { launchFreshApp , reinstallApp } from '../helpers/setup' ;
@@ -380,7 +380,7 @@ describe('@settings - Settings', () => {
380380
381381 // disconnected warning should appear
382382 await elementById ( 'Disconnected' ) . waitForDisplayed ( ) ;
383- await sleep ( 1000 ) ;
383+ await waitForToast ( 'ElectrumErrorToast' ) ;
384384
385385 // scanner - check all possible connection formats
386386 // Umbrel format
@@ -397,20 +397,6 @@ describe('@settings - Settings', () => {
397397 expectedProtocol : 'TLS' ,
398398 } ;
399399
400- // should detect protocol for common ports
401- const noProto1 = {
402- url : `${ electrumHost } :50001` ,
403- expectedHost : electrumHost ,
404- expectedPort : '50001' ,
405- expectedProtocol : 'TCP' ,
406- } ;
407- const noProto2 = {
408- url : `${ electrumHost } :50002` ,
409- expectedHost : electrumHost ,
410- expectedPort : '50002' ,
411- expectedProtocol : 'TLS' ,
412- } ;
413-
414400 // HTTP URL
415401 const http1 = {
416402 url : `http://${ electrumHost } :${ electrumPort } ` ,
@@ -425,7 +411,7 @@ describe('@settings - Settings', () => {
425411 expectedProtocol : 'TLS' ,
426412 } ;
427413
428- const conns = [ umbrel1 , umbrel2 , noProto1 , noProto2 , http1 , http2 ] ;
414+ const conns = [ umbrel1 , umbrel2 , http1 , http2 ] ;
429415 let i = 0 ;
430416 for ( const conn of conns ) {
431417 await sleep ( 1000 ) ;
@@ -437,6 +423,7 @@ describe('@settings - Settings', () => {
437423 await tap ( 'ScanPrompt' ) ;
438424 await typeText ( 'QRInput' , conn . url ) ;
439425 await tap ( 'DialogConfirm' ) ;
426+ await waitForToast ( 'ElectrumUpdatedToast' ) ;
440427 await expect ( await elementById ( 'HostInput' ) ) . toHaveText ( conn . expectedHost ) ;
441428 expect ( await elementById ( 'PortInput' ) ) . toHaveText ( conn . expectedPort ) ;
442429 // await expectTextWithin('ElectrumProtocol', conn.expectedProtocol);
@@ -447,6 +434,7 @@ describe('@settings - Settings', () => {
447434 await elementById ( 'ResetToDefault' ) . waitForEnabled ( ) ;
448435 await tap ( 'ResetToDefault' ) ;
449436 await tap ( 'ConnectToHost' ) ;
437+ await waitForToast ( 'ElectrumUpdatedToast' , { waitToDisappear : false } ) ;
450438 await elementById ( 'Connected' ) . waitForDisplayed ( ) ;
451439 await sleep ( 1000 ) ;
452440 } ) ;
@@ -467,16 +455,14 @@ describe('@settings - Settings', () => {
467455 await typeText ( 'RGSUrl' , newUrl ) ;
468456 await confirmInputOnKeyboard ( ) ;
469457 await tap ( 'ConnectToHost' ) ;
470- const updatedMsg = 'Rapid-Gossip-Sync Server Updated' ;
471- await expectText ( updatedMsg ) ;
472- await expectText ( updatedMsg , { visible : false } ) ;
458+ await waitForToast ( 'RgsUpdatedToast' ) ;
473459 const updatedUrl = await ( await elementById ( 'ConnectedUrl' ) ) . getText ( ) ;
474460 await expect ( updatedUrl ) . toBe ( newUrl ) ;
475461
476462 // switch back to default
477463 await tap ( 'ResetToDefault' ) ;
478464 await tap ( 'ConnectToHost' ) ;
479- await expectText ( updatedMsg ) ;
465+ await waitForToast ( 'RgsUpdatedToast' , { waitToDisappear : false } ) ;
480466
481467 const resetUrl = await ( await elementById ( 'ConnectedUrl' ) ) . getText ( ) ;
482468 await expect ( resetUrl ) . toBe ( rgsUrl ) ;
0 commit comments