@@ -13,7 +13,6 @@ import {
1313 swipeFullScreen ,
1414 dragOnElement ,
1515 completeOnboarding ,
16- acceptAppNotificationAlert ,
1716 multiTap ,
1817 receiveOnchainFunds ,
1918 expectTextWithin ,
@@ -23,6 +22,7 @@ import {
2322 doNavigationClose ,
2423 waitForToast ,
2524 dismissBackgroundPaymentsTimedSheet ,
25+ enterAddressViaScanPrompt ,
2626} from '../helpers/actions' ;
2727import { reinstallApp } from '../helpers/setup' ;
2828import { ciIt } from '../helpers/suite' ;
@@ -120,13 +120,7 @@ describe('@lnurl - LNURL', () => {
120120 } ) ;
121121 console . log ( 'channelReq' , channelReq ) ;
122122
123- await tap ( 'Scan' ) ;
124- // on the first time we need to accept the notifications permission dialog to use camera
125- await acceptAppNotificationAlert ( 'permission_allow_foreground_only_button' ) ;
126- await tap ( 'ScanPrompt' ) ;
127- await typeText ( 'QRInput' , channelReq . encoded ) ;
128- await confirmInputOnKeyboard ( ) ;
129- await tap ( 'DialogConfirm' ) ;
123+ await enterAddressViaScanPrompt ( channelReq . encoded ) ;
130124
131125 const channelRequestPromise = waitForEvent ( lnurlServer , 'channelRequest:action' ) ;
132126 await elementById ( 'ConnectButton' ) . waitForDisplayed ( ) ;
@@ -166,11 +160,7 @@ describe('@lnurl - LNURL', () => {
166160 } ) ;
167161 console . log ( 'payRequest1' , payRequest1 ) ;
168162
169- await tap ( 'Scan' ) ;
170- await tap ( 'ScanPrompt' ) ;
171- await typeText ( 'QRInput' , payRequest1 . encoded ) ;
172- await confirmInputOnKeyboard ( ) ;
173- await tap ( 'DialogConfirm' ) ;
163+ await enterAddressViaScanPrompt ( payRequest1 . encoded , { acceptCameraPermission : false } ) ;
174164 await expectTextWithin ( 'SendNumberField' , sats ) ;
175165 // Check amounts 99 - 201 not allowed
176166 await multiTap ( 'NRemove' , 3 ) ; // remove "100"
@@ -230,21 +220,11 @@ describe('@lnurl - LNURL', () => {
230220 console . log ( 'payRequest2' , payRequest2 ) ;
231221
232222 try {
233- await tap ( 'Scan' ) ;
234- await tap ( 'ScanPrompt' ) ;
235- await typeText ( 'QRInput' , payRequest2 . encoded ) ;
236- await confirmInputOnKeyboard ( ) ;
237- await tap ( 'DialogConfirm' ) ;
238- await sleep ( 1000 ) ;
223+ await enterAddressViaScanPrompt ( payRequest2 . encoded , { acceptCameraPermission : false } ) ;
239224 await elementById ( 'ReviewAmount-primary' ) . waitForDisplayed ( { timeout : 5000 } ) ;
240225 } catch {
241226 console . warn ( 'ReviewAmount not found, trying again' ) ;
242- await dismissQuickPayIntro ( { triggerTimedSheet : driver . isIOS } ) ;
243- await tap ( 'Scan' ) ;
244- await tap ( 'ScanPrompt' ) ;
245- await typeText ( 'QRInput' , payRequest2 . encoded ) ;
246- await confirmInputOnKeyboard ( ) ;
247- await tap ( 'DialogConfirm' ) ;
227+ await enterAddressViaScanPrompt ( payRequest2 . encoded , { acceptCameraPermission : false } ) ;
248228 await sleep ( 1000 ) ;
249229 }
250230 // Comment input should not be visible
@@ -302,20 +282,15 @@ describe('@lnurl - LNURL', () => {
302282 console . log ( 'withdrawRequest1' , withdrawRequest1 ) ;
303283
304284 try {
305- await tap ( 'Scan' ) ;
306- await tap ( 'ScanPrompt' ) ;
307- await typeText ( 'QRInput' , withdrawRequest1 . encoded ) ;
308- await confirmInputOnKeyboard ( ) ;
309- await tap ( 'DialogConfirm' ) ;
285+ await enterAddressViaScanPrompt ( withdrawRequest1 . encoded , {
286+ acceptCameraPermission : false ,
287+ } ) ;
310288 await elementById ( 'SendNumberField' ) . waitForDisplayed ( { timeout : 5000 } ) ;
311289 } catch {
312290 console . warn ( 'SendNumberField not found, trying again' ) ;
313- await dismissQuickPayIntro ( { triggerTimedSheet : driver . isIOS } ) ;
314- await tap ( 'Scan' ) ;
315- await tap ( 'ScanPrompt' ) ;
316- await typeText ( 'QRInput' , withdrawRequest1 . encoded ) ;
317- await confirmInputOnKeyboard ( ) ;
318- await tap ( 'DialogConfirm' ) ;
291+ await enterAddressViaScanPrompt ( withdrawRequest1 . encoded , {
292+ acceptCameraPermission : false ,
293+ } ) ;
319294 }
320295 await expectTextWithin ( 'SendNumberField' , '102' ) ;
321296 await tap ( 'ContinueAmount' ) ;
@@ -365,14 +340,10 @@ describe('@lnurl - LNURL', () => {
365340 // lnurl-auth
366341 const loginRequest1 = await lnurlServer . generateNewUrl ( 'login' ) ;
367342 console . log ( 'loginRequest1' , loginRequest1 ) ;
368- await tap ( 'Scan' ) ;
369- await tap ( 'ScanPrompt' ) ;
370- await typeText ( 'QRInput' , loginRequest1 . encoded ) ;
371- const loginEvent = new Promise < void > ( ( resolve ) => lnurlServer . once ( 'login' , resolve ) ) ;
372- await confirmInputOnKeyboard ( ) ;
373- await tap ( 'DialogConfirm' ) ;
343+ await enterAddressViaScanPrompt ( loginRequest1 . encoded , { acceptCameraPermission : false } ) ;
374344 await tap ( 'continue_button' ) ;
375345 await expectText ( 'Signed In' ) ;
346+ const loginEvent = new Promise < void > ( ( resolve ) => lnurlServer . once ( 'login' , resolve ) ) ;
376347 await loginEvent ;
377348 }
378349 ) ;
0 commit comments