From 6a0eca74f411496843f22fde28ef3621c24c8efa Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Mon, 8 Dec 2025 09:21:45 +0100 Subject: [PATCH 1/4] operate permission to use cam notification --- test/helpers/actions.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 344fa77..cdebdc7 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -852,6 +852,7 @@ export async function typeAddressAndVerifyContinue({ export async function enterAddress(address: string) { await tap('Send'); await sleep(700); + await acceptAppNotificationAlert('permission_allow_one_time_button'); await tap('RecipientManual'); await typeAddressAndVerifyContinue({ address }); await tap('AddressContinue'); From ea0bbaf36ca97d662ea2afeaa73f64332f4b2045 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Mon, 8 Dec 2025 09:46:49 +0100 Subject: [PATCH 2/4] use enterAddress on boost_2 --- test/specs/boost.e2e.ts | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/test/specs/boost.e2e.ts b/test/specs/boost.e2e.ts index c5bb101..6582410 100644 --- a/test/specs/boost.e2e.ts +++ b/test/specs/boost.e2e.ts @@ -6,8 +6,6 @@ import { tap, elementById, receiveOnchainFunds, - typeText, - confirmInputOnKeyboard, expectText, dragOnElement, swipeFullScreen, @@ -19,6 +17,7 @@ import { getSeed, waitForBackup, restoreWallet, + enterAddress, } from '../helpers/actions'; import { bitcoinURL } from '../helpers/constants'; import initElectrum from '../helpers/electrum'; @@ -145,18 +144,7 @@ describe('@boost - Boost', () => { // Send 10 000 const coreAddress = await rpc.getNewAddress(); - await tap('Send'); - await sleep(1000); - try { - await tap('RecipientManual'); - await elementById('RecipientInput').waitForDisplayed(); - } catch { - console.warn('RecipientInput not found, trying again'); - await tap('RecipientManual'); - } - await typeText('RecipientInput', coreAddress); - await confirmInputOnKeyboard(); - await tap('AddressContinue'); + await enterAddress(coreAddress); await tap('N1'); await tap('N0'); await tap('N000'); From 296fa37f6b44f38a19b343ec76f8ecf77069140a Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Mon, 8 Dec 2025 09:47:06 +0100 Subject: [PATCH 3/4] adjust send_1 --- test/specs/send.e2e.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/specs/send.e2e.ts b/test/specs/send.e2e.ts index cb94111..0088adb 100644 --- a/test/specs/send.e2e.ts +++ b/test/specs/send.e2e.ts @@ -20,6 +20,7 @@ import { mineBlocks, dismissQuickPayIntro, doNavigationClose, + acceptAppNotificationAlert, } from '../helpers/actions'; import { bitcoinURL, lndConfig } from '../helpers/constants'; import { reinstallApp } from '../helpers/setup'; @@ -63,6 +64,7 @@ describe('@send - Send', () => { ciIt('@send_1 - Validates payment data in the manual input', async () => { await tap('Send'); + await acceptAppNotificationAlert('permission_allow_foreground_only_button'); await tap('RecipientManual'); // check validation for empty address From 3a14361f37470f56f6e724c8a4e8ef65bbcb88d4 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Mon, 8 Dec 2025 10:28:32 +0100 Subject: [PATCH 4/4] add acceptCameraPermission switch --- test/helpers/actions.ts | 6 ++++-- test/specs/send.e2e.ts | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index cdebdc7..c8a777b 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -849,10 +849,12 @@ export async function typeAddressAndVerifyContinue({ await elementById('AddressContinue').waitForEnabled({ reverse }); } -export async function enterAddress(address: string) { +export async function enterAddress(address: string, { acceptCameraPermission = true } = {}) { await tap('Send'); await sleep(700); - await acceptAppNotificationAlert('permission_allow_one_time_button'); + if (acceptCameraPermission) { + await acceptAppNotificationAlert('permission_allow_one_time_button'); + } await tap('RecipientManual'); await typeAddressAndVerifyContinue({ address }); await tap('AddressContinue'); diff --git a/test/specs/send.e2e.ts b/test/specs/send.e2e.ts index 0088adb..7f20238 100644 --- a/test/specs/send.e2e.ts +++ b/test/specs/send.e2e.ts @@ -224,7 +224,7 @@ describe('@send - Send', () => { const { paymentRequest: invoice1 } = await lnd.addInvoice({}); console.info({ invoice1 }); await sleep(1000); - await enterAddress(invoice1); + await enterAddress(invoice1, { acceptCameraPermission: false }); await elementById('AssetButton-spending').waitForDisplayed(); await tap('N2'); await multiTap('N0', 3); @@ -242,7 +242,7 @@ describe('@send - Send', () => { console.info('Editing invoice on review screen...'); const { paymentRequest: invoice2 } = await lnd.addInvoice({ value: '2000' }); console.info({ invoice2 }); - await enterAddress(invoice2); + await enterAddress(invoice2, { acceptCameraPermission: false }); const reviewAmt = await elementByIdWithin('ReviewAmount-primary', 'MoneyText'); await reviewAmt.waitForDisplayed(); await expect(reviewAmt).toHaveText('2 000'); @@ -282,7 +282,7 @@ describe('@send - Send', () => { }); console.info({ unified1 }); await sleep(1000); - await enterAddress(unified1); + await enterAddress(unified1, { acceptCameraPermission: false }); await expect(reviewAmt).toHaveText('1 000'); // invoice amount await dragOnElement('GRAB', 'right', 0.95); await elementById('SendSuccess').waitForDisplayed(); @@ -304,7 +304,7 @@ describe('@send - Send', () => { }); console.info({ unified2 }); await sleep(1000); - await enterAddress(unified2); + await enterAddress(unified2, { acceptCameraPermission: false }); // should only allow spending from savings await elementById('AssetButton-savings').waitForDisplayed(); await sleep(500); @@ -336,7 +336,7 @@ describe('@send - Send', () => { // // console.info(JSON.stringify(dec, null, 2)); // await sleep(1000); - // await enterAddress(unified3); + // await enterAddress(unified3, { acceptCameraPermission: false }); // await elementById('AssetButton-savings').waitForDisplayed(); // await tap('N1'); // await multiTap('N0', 4); @@ -360,7 +360,7 @@ describe('@send - Send', () => { const unified4 = encode(onchainAddress, { lightning: invoice5 }); console.info({ unified4 }); await sleep(1000); - await enterAddress(unified4); + await enterAddress(unified4, { acceptCameraPermission: false }); // max amount (lightning) await expectText('6 000', { strategy: 'contains' }); // current balance 8k - 1k reserve balance await tap('AssetButton-switch'); @@ -386,7 +386,7 @@ describe('@send - Send', () => { const unified5 = encode(onchainAddress, { lightning: invoice6 }); console.info({ unified5 }); await sleep(1000); - await enterAddress(unified5); + await enterAddress(unified5, { acceptCameraPermission: false }); // max amount (lightning) await tap('AvailableAmount'); await tap('ContinueAmount'); @@ -428,7 +428,7 @@ describe('@send - Send', () => { await doNavigationClose(); await sleep(1000); - await enterAddress(invoice7); + await enterAddress(invoice7, { acceptCameraPermission: false }); await elementById('SendSuccess').waitForDisplayed(); await sleep(500); await tap('Close'); @@ -445,7 +445,7 @@ describe('@send - Send', () => { }); console.info({ unified7 }); await sleep(1000); - await enterAddress(unified7); + await enterAddress(unified7, { acceptCameraPermission: false }); await elementById('SendSuccess').waitForDisplayed(); await sleep(500); await tap('Close'); @@ -471,7 +471,7 @@ describe('@send - Send', () => { const { paymentRequest: invoice9 } = await lnd.addInvoice({ value: '10000' }); console.info({ invoice9 }); await sleep(1000); - await enterAddress(invoice9); + await enterAddress(invoice9, { acceptCameraPermission: false }); await elementById('ReviewAmount').waitForDisplayed(); await swipeFullScreen('down'); });