Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion test/helpers/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -849,9 +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);
if (acceptCameraPermission) {
await acceptAppNotificationAlert('permission_allow_one_time_button');
}
await tap('RecipientManual');
await typeAddressAndVerifyContinue({ address });
await tap('AddressContinue');
Expand Down
16 changes: 2 additions & 14 deletions test/specs/boost.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {
tap,
elementById,
receiveOnchainFunds,
typeText,
confirmInputOnKeyboard,
expectText,
dragOnElement,
swipeFullScreen,
Expand All @@ -19,6 +17,7 @@ import {
getSeed,
waitForBackup,
restoreWallet,
enterAddress,
} from '../helpers/actions';
import { bitcoinURL } from '../helpers/constants';
import initElectrum from '../helpers/electrum';
Expand Down Expand Up @@ -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');
Expand Down
22 changes: 12 additions & 10 deletions test/specs/send.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
mineBlocks,
dismissQuickPayIntro,
doNavigationClose,
acceptAppNotificationAlert,
} from '../helpers/actions';
import { bitcoinURL, lndConfig } from '../helpers/constants';
import { reinstallApp } from '../helpers/setup';
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -222,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);
Expand All @@ -240,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');
Expand Down Expand Up @@ -280,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();
Expand All @@ -302,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);
Expand Down Expand Up @@ -334,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);
Expand All @@ -358,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');
Expand All @@ -384,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');
Expand Down Expand Up @@ -426,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');
Expand All @@ -443,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');
Expand All @@ -469,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');
});
Expand Down