diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 0140c75..344fa77 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -715,12 +715,25 @@ export async function acknowledgeReceivedPayment() { * await doTriggerTimedSheet(); */ export async function doTriggerTimedSheet() { + await sleep(700); // wait for any previous animations to finish await tap('HeaderMenu'); await tap('DrawerSettings'); await sleep(500); // wait for the app to settle await doNavigationClose(); } +export async function dismissBackgroundPaymentsTimedSheet({ + triggerTimedSheet = false, +}: { triggerTimedSheet?: boolean } = {}) { + if (triggerTimedSheet) { + await doTriggerTimedSheet(); + } + await elementById('BackgroundPaymentsDescription').waitForDisplayed(); + await sleep(500); // wait for the app to settle + await tap('BackgroundPaymentsCancel'); + await sleep(500); +} + /** * Dismisses the backup reminder sheet. * This sheet is triggered by first onchain balance change. @@ -744,7 +757,7 @@ export async function dismissBackupTimedSheet({ } await elementById('BackupIntroViewDescription').waitForDisplayed(); await sleep(500); // wait for the app to settle - await tap('BackupIntroViewCancel'); + await swipeFullScreen('down'); await sleep(500); } @@ -766,14 +779,22 @@ export async function dismissBackupTimedSheet({ export async function dismissQuickPayIntro({ triggerTimedSheet = false, }: { triggerTimedSheet?: boolean } = {}) { - if (driver.isIOS) return; // Not supported on iOS yet if (triggerTimedSheet) { await doTriggerTimedSheet(); } - await elementById('QuickpayIntro-button').waitForDisplayed(); - await sleep(500); // wait for the app to settle - await swipeFullScreen('down'); - await sleep(500); + + if (driver.isAndroid) { + // TODO: it's temp, change on Android to match iOS testID + await elementById('QuickpayIntro-button').waitForDisplayed(); + await sleep(500); // wait for the app to settle + await swipeFullScreen('down'); + await sleep(500); + } else { + await elementById('QuickpayIntroDescription').waitForDisplayed(); + await sleep(500); // wait for the app to settle + await tap('QuickpayIntroCancel'); + await sleep(500); + } } /** diff --git a/test/specs/lightning.e2e.ts b/test/specs/lightning.e2e.ts index 4562398..4d62309 100644 --- a/test/specs/lightning.e2e.ts +++ b/test/specs/lightning.e2e.ts @@ -23,6 +23,7 @@ import { elementByText, dismissQuickPayIntro, doNavigationClose, + dismissBackgroundPaymentsTimedSheet, acknowledgeReceivedPayment, waitForBackup, } from '../helpers/actions'; @@ -111,8 +112,13 @@ describe('@lightning - Lightning', () => { console.info({ response }); await elementById('ReceivedTransaction').waitForDisplayed(); await tap('ReceivedTransactionButton'); - await sleep(500); - await dismissQuickPayIntro(); + await sleep(1000); + if (driver.isIOS) { + await dismissBackgroundPaymentsTimedSheet({ triggerTimedSheet: driver.isIOS }); + await dismissQuickPayIntro({ triggerTimedSheet: driver.isIOS }); + } else { + await dismissQuickPayIntro(); + } const totalBalance = await elementByIdWithin('TotalBalance-primary', 'MoneyText'); await expect(totalBalance).toHaveText('11 000'); // 1k onchain + 10k lightning await expectTextWithin('ActivitySpending', '10 000'); @@ -196,6 +202,7 @@ describe('@lightning - Lightning', () => { await swipeFullScreen('up'); await swipeFullScreen('up'); await tap('ActivityShowAll'); + // All transactions await expectTextWithin('Activity-1', '-'); await expectTextWithin('Activity-2', '-'); @@ -280,7 +287,9 @@ describe('@lightning - Lightning', () => { await mineBlocks(rpc, 6); await electrum?.waitForSync(); await elementById('Channel').waitForDisplayed({ reverse: true }); - await tap('NavigationBack'); + if (driver.isAndroid) { + await tap('NavigationBack'); + } await doNavigationClose(); await swipeFullScreen('up');