Skip to content

Commit 6bbcb05

Browse files
authored
Merge branch 'main' into test/lnurl
2 parents 7b01149 + c52f79f commit 6bbcb05

File tree

3 files changed

+19
-26
lines changed

3 files changed

+19
-26
lines changed

test/helpers/actions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,9 +851,12 @@ export async function typeAddressAndVerifyContinue({
851851
await elementById('AddressContinue').waitForEnabled({ reverse });
852852
}
853853

854-
export async function enterAddress(address: string) {
854+
export async function enterAddress(address: string, { acceptCameraPermission = true } = {}) {
855855
await tap('Send');
856856
await sleep(700);
857+
if (acceptCameraPermission) {
858+
await acceptAppNotificationAlert('permission_allow_one_time_button');
859+
}
857860
await tap('RecipientManual');
858861
await typeAddressAndVerifyContinue({ address });
859862
await tap('AddressContinue');

test/specs/boost.e2e.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import {
66
tap,
77
elementById,
88
receiveOnchainFunds,
9-
typeText,
10-
confirmInputOnKeyboard,
119
expectText,
1210
dragOnElement,
1311
swipeFullScreen,
@@ -19,6 +17,7 @@ import {
1917
getSeed,
2018
waitForBackup,
2119
restoreWallet,
20+
enterAddress,
2221
} from '../helpers/actions';
2322
import { bitcoinURL } from '../helpers/constants';
2423
import initElectrum from '../helpers/electrum';
@@ -145,18 +144,7 @@ describe('@boost - Boost', () => {
145144

146145
// Send 10 000
147146
const coreAddress = await rpc.getNewAddress();
148-
await tap('Send');
149-
await sleep(1000);
150-
try {
151-
await tap('RecipientManual');
152-
await elementById('RecipientInput').waitForDisplayed();
153-
} catch {
154-
console.warn('RecipientInput not found, trying again');
155-
await tap('RecipientManual');
156-
}
157-
await typeText('RecipientInput', coreAddress);
158-
await confirmInputOnKeyboard();
159-
await tap('AddressContinue');
147+
await enterAddress(coreAddress);
160148
await tap('N1');
161149
await tap('N0');
162150
await tap('N000');

test/specs/send.e2e.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
dismissQuickPayIntro,
2222
doNavigationClose,
2323
waitForToast,
24+
acceptAppNotificationAlert,
2425
} from '../helpers/actions';
2526
import { bitcoinURL, lndConfig } from '../helpers/constants';
2627
import { reinstallApp } from '../helpers/setup';
@@ -32,7 +33,7 @@ import {
3233
waitForPeerConnection,
3334
waitForActiveChannel,
3435
openLNDAndSync,
35-
checkChannelStatus,
36+
checkChannelStatus
3637
} from '../helpers/lnd';
3738
import { ciIt } from '../helpers/suite';
3839

@@ -64,6 +65,7 @@ describe('@send - Send', () => {
6465

6566
ciIt('@send_1 - Validates payment data in the manual input', async () => {
6667
await tap('Send');
68+
await acceptAppNotificationAlert('permission_allow_foreground_only_button');
6769
await tap('RecipientManual');
6870

6971
// check validation for empty address
@@ -223,7 +225,7 @@ describe('@send - Send', () => {
223225
const { paymentRequest: invoice1 } = await lnd.addInvoice({});
224226
console.info({ invoice1 });
225227
await sleep(1000);
226-
await enterAddress(invoice1);
228+
await enterAddress(invoice1, { acceptCameraPermission: false });
227229
await elementById('AssetButton-spending').waitForDisplayed();
228230
await tap('N2');
229231
await multiTap('N0', 3);
@@ -241,7 +243,7 @@ describe('@send - Send', () => {
241243
console.info('Editing invoice on review screen...');
242244
const { paymentRequest: invoice2 } = await lnd.addInvoice({ value: '2000' });
243245
console.info({ invoice2 });
244-
await enterAddress(invoice2);
246+
await enterAddress(invoice2, { acceptCameraPermission: false });
245247
const reviewAmt = await elementByIdWithin('ReviewAmount-primary', 'MoneyText');
246248
await reviewAmt.waitForDisplayed();
247249
await expect(reviewAmt).toHaveText('2 000');
@@ -281,7 +283,7 @@ describe('@send - Send', () => {
281283
});
282284
console.info({ unified1 });
283285
await sleep(1000);
284-
await enterAddress(unified1);
286+
await enterAddress(unified1, { acceptCameraPermission: false });
285287
await expect(reviewAmt).toHaveText('1 000'); // invoice amount
286288
await dragOnElement('GRAB', 'right', 0.95);
287289
await elementById('SendSuccess').waitForDisplayed();
@@ -303,7 +305,7 @@ describe('@send - Send', () => {
303305
});
304306
console.info({ unified2 });
305307
await sleep(1000);
306-
await enterAddress(unified2);
308+
await enterAddress(unified2, { acceptCameraPermission: false });
307309
// should only allow spending from savings
308310
await elementById('AssetButton-savings').waitForDisplayed();
309311
await sleep(500);
@@ -335,7 +337,7 @@ describe('@send - Send', () => {
335337
// // console.info(JSON.stringify(dec, null, 2));
336338

337339
// await sleep(1000);
338-
// await enterAddress(unified3);
340+
// await enterAddress(unified3, { acceptCameraPermission: false });
339341
// await elementById('AssetButton-savings').waitForDisplayed();
340342
// await tap('N1');
341343
// await multiTap('N0', 4);
@@ -359,7 +361,7 @@ describe('@send - Send', () => {
359361
const unified4 = encode(onchainAddress, { lightning: invoice5 });
360362
console.info({ unified4 });
361363
await sleep(1000);
362-
await enterAddress(unified4);
364+
await enterAddress(unified4, { acceptCameraPermission: false });
363365
// max amount (lightning)
364366
await expectText('6 000', { strategy: 'contains' }); // current balance 8k - 1k reserve balance
365367
await tap('AssetButton-switch');
@@ -385,7 +387,7 @@ describe('@send - Send', () => {
385387
const unified5 = encode(onchainAddress, { lightning: invoice6 });
386388
console.info({ unified5 });
387389
await sleep(1000);
388-
await enterAddress(unified5);
390+
await enterAddress(unified5, { acceptCameraPermission: false });
389391
// max amount (lightning)
390392
await tap('AvailableAmount');
391393
await tap('ContinueAmount');
@@ -427,7 +429,7 @@ describe('@send - Send', () => {
427429
await doNavigationClose();
428430

429431
await sleep(1000);
430-
await enterAddress(invoice7);
432+
await enterAddress(invoice7, { acceptCameraPermission: false });
431433
await elementById('SendSuccess').waitForDisplayed();
432434
await sleep(500);
433435
await tap('Close');
@@ -444,7 +446,7 @@ describe('@send - Send', () => {
444446
});
445447
console.info({ unified7 });
446448
await sleep(1000);
447-
await enterAddress(unified7);
449+
await enterAddress(unified7, { acceptCameraPermission: false });
448450
await elementById('SendSuccess').waitForDisplayed();
449451
await sleep(500);
450452
await tap('Close');
@@ -470,7 +472,7 @@ describe('@send - Send', () => {
470472
const { paymentRequest: invoice9 } = await lnd.addInvoice({ value: '10000' });
471473
console.info({ invoice9 });
472474
await sleep(1000);
473-
await enterAddress(invoice9);
475+
await enterAddress(invoice9, { acceptCameraPermission: false });
474476
await elementById('ReviewAmount').waitForDisplayed();
475477
await swipeFullScreen('down');
476478
});

0 commit comments

Comments
 (0)