@@ -24,6 +24,7 @@ import {
2424 enterAddressViaScanPrompt ,
2525 acknowledgeReceivedPayment ,
2626 acknowledgeExternalSuccess ,
27+ enterAmount ,
2728} from '../helpers/actions' ;
2829import { reinstallApp } from '../helpers/setup' ;
2930import { ciIt } from '../helpers/suite' ;
@@ -177,27 +178,25 @@ describe('@lnurl - LNURL', () => {
177178 await enterAddressViaScanPrompt ( payRequest1 . encoded , { acceptCameraPermission : false } ) ;
178179 await expectTextWithin ( 'SendNumberField' , '0' ) ;
179180 // Check that 149 sats is below minimum and 201 sats is above maximum (both rejected)
180- await tap ( 'N2' ) ;
181- await tap ( 'N0' ) ;
182- await tap ( 'N1' ) ;
183- if ( driver . isAndroid ) {
184- await waitForToast ( 'SendAmountExceededToast' ) ;
185- } else {
186- await elementById ( 'ContinueAmount' ) . waitForEnabled ( { reverse : true } ) ;
181+ try {
182+ await enterAmount ( 201 ) ;
183+ await waitForToast ( 'SendAmountExceededToast' , { dismiss : driver . isAndroid } ) ;
184+ } catch {
185+ console . warn ( 'SendAmountExceededToast not triggered, trying again...' ) ;
186+ // tap on 1 fast to trigger the toast
187+ await elementById ( 'N1' ) . click ( ) ;
188+ await waitForToast ( 'SendAmountExceededToast' , { dismiss : driver . isAndroid } ) ;
187189 }
190+
188191 await multiTap ( 'NRemove' , 3 ) ; // remove "201"
189- await tap ( 'N1' ) ;
190- await tap ( 'N4' ) ;
191- await tap ( 'N9' ) ;
192+ await enterAmount ( 149 ) ;
192193 await expectTextWithin ( 'SendNumberField' , '149' ) ;
193194 await tap ( 'ContinueAmount' ) ;
194195 await waitForToast ( 'LnurlPayAmountTooLowToast' ) ;
195196
196197 await multiTap ( 'NRemove' , 3 ) ; // remove "149"
197198 // go with 150
198- await tap ( 'N1' ) ;
199- await tap ( 'N5' ) ;
200- await tap ( 'N0' ) ;
199+ await enterAmount ( 150 ) ;
201200 await expectTextWithin ( 'SendNumberField' , '150' ) ;
202201 await elementById ( 'ContinueAmount' ) . waitForEnabled ( ) ;
203202 await tap ( 'ContinueAmount' ) ;
@@ -264,9 +263,7 @@ describe('@lnurl - LNURL', () => {
264263 await enterAddress ( payRequest3 . encoded , { acceptCameraPermission : false } ) ;
265264 await expectTextWithin ( 'SendNumberField' , '0' ) ;
266265 // go with 321
267- await tap ( 'N3' ) ;
268- await tap ( 'N2' ) ;
269- await tap ( 'N1' ) ;
266+ await enterAmount ( 321 ) ;
270267 await elementById ( 'ContinueAmount' ) . waitForDisplayed ( ) ;
271268 await tap ( 'ContinueAmount' ) ;
272269 await dragOnElement ( 'GRAB' , 'right' , 0.95 ) ;
0 commit comments