Skip to content

Commit 6055fec

Browse files
committed
Adjust lightning
1 parent 71782ae commit 6055fec

File tree

2 files changed

+37
-8
lines changed

2 files changed

+37
-8
lines changed

test/helpers/actions.ts

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,18 @@ export async function doTriggerTimedSheet() {
715715
await doNavigationClose();
716716
}
717717

718+
export async function dismissBackgroundPaymentsTimedSheet({
719+
triggerTimedSheet = false,
720+
}: { triggerTimedSheet?: boolean } = {}) {
721+
if (triggerTimedSheet) {
722+
await doTriggerTimedSheet();
723+
}
724+
await elementById('BackgroundPaymentsDescription').waitForDisplayed();
725+
await sleep(500); // wait for the app to settle
726+
await tap('BackgroundPaymentsCancel');
727+
await sleep(500);
728+
}
729+
718730
/**
719731
* Dismisses the backup reminder sheet.
720732
* This sheet is triggered by first onchain balance change.
@@ -738,7 +750,7 @@ export async function dismissBackupTimedSheet({
738750
}
739751
await elementById('BackupIntroViewDescription').waitForDisplayed();
740752
await sleep(500); // wait for the app to settle
741-
await tap('BackupIntroViewCancel');
753+
await swipeFullScreen('down');
742754
await sleep(500);
743755
}
744756

@@ -760,14 +772,22 @@ export async function dismissBackupTimedSheet({
760772
export async function dismissQuickPayIntro({
761773
triggerTimedSheet = false,
762774
}: { triggerTimedSheet?: boolean } = {}) {
763-
if (driver.isIOS) return; // Not supported on iOS yet
764775
if (triggerTimedSheet) {
765776
await doTriggerTimedSheet();
766777
}
767-
await elementById('QuickpayIntro-button').waitForDisplayed();
768-
await sleep(500); // wait for the app to settle
769-
await swipeFullScreen('down');
770-
await sleep(500);
778+
779+
if (driver.isAndroid) {
780+
// TODO: it's temp, change on Android to match iOS testID
781+
await elementById('QuickpayIntro-button').waitForDisplayed();
782+
await sleep(500); // wait for the app to settle
783+
await swipeFullScreen('down');
784+
await sleep(500);
785+
} else {
786+
await elementById('QuickpayIntroDescription').waitForDisplayed();
787+
await sleep(500); // wait for the app to settle
788+
await tap('QuickpayIntroCancel');
789+
await sleep(500);
790+
}
771791
}
772792

773793
/**

test/specs/lightning.e2e.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
doNavigationClose,
2626
acknowledgeReceivedPayment,
2727
waitForBackup,
28+
dismissBackgroundPaymentsTimedSheet,
2829
} from '../helpers/actions';
2930
import { reinstallApp } from '../helpers/setup';
3031
import { bitcoinURL, lndConfig } from '../helpers/constants';
@@ -112,7 +113,12 @@ describe('@lightning - Lightning', () => {
112113
await elementById('ReceivedTransaction').waitForDisplayed();
113114
await tap('ReceivedTransactionButton');
114115
await sleep(500);
115-
await dismissQuickPayIntro();
116+
if (driver.isIOS) {
117+
await dismissBackgroundPaymentsTimedSheet({ triggerTimedSheet: driver.isIOS });
118+
await dismissQuickPayIntro({ triggerTimedSheet: driver.isIOS });
119+
} else {
120+
await dismissQuickPayIntro();
121+
}
116122
const totalBalance = await elementByIdWithin('TotalBalance-primary', 'MoneyText');
117123
await expect(totalBalance).toHaveText('11 000'); // 1k onchain + 10k lightning
118124
await expectTextWithin('ActivitySpending', '10 000');
@@ -196,6 +202,7 @@ describe('@lightning - Lightning', () => {
196202
await swipeFullScreen('up');
197203
await swipeFullScreen('up');
198204
await tap('ActivityShowAll');
205+
199206
// All transactions
200207
await expectTextWithin('Activity-1', '-');
201208
await expectTextWithin('Activity-2', '-');
@@ -280,7 +287,9 @@ describe('@lightning - Lightning', () => {
280287
await mineBlocks(rpc, 6);
281288
await electrum?.waitForSync();
282289
await elementById('Channel').waitForDisplayed({ reverse: true });
283-
await tap('NavigationBack');
290+
if (driver.isAndroid) {
291+
await tap('NavigationBack');
292+
}
284293
await doNavigationClose();
285294

286295
await swipeFullScreen('up');

0 commit comments

Comments
 (0)