Skip to content
Open
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
25 changes: 8 additions & 17 deletions test/helpers/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ export async function confirmInputOnKeyboard() {
}
}

export async function acceptAppNotificationAlert(
export async function handleAndroidAlert(
button: string = 'permission_allow_button'
): Promise<void> {
if (driver.isAndroid) {
Expand Down Expand Up @@ -503,7 +503,7 @@ export async function completeOnboarding({ isFirstTime = true } = {}) {
await waitForSetupWalletScreenFinish();

if (isFirstTime) {
await acceptAppNotificationAlert();
await handleAndroidAlert();
}

// Wait for wallet to be created
Expand Down Expand Up @@ -559,7 +559,7 @@ export async function restoreWallet(
await tap('RestoreButton');
await waitForSetupWalletScreenFinish();

await acceptAppNotificationAlert();
await handleAndroidAlert();

// Wait for Get Started
const getStarted = await elementById('GetStartedButton');
Expand Down Expand Up @@ -672,21 +672,12 @@ export async function receiveOnchainFunds(

await mineBlocks(rpc, blocksToMine);

if (driver.isAndroid) {
await dismissBackupTimedSheet();
if (expectHighBalanceWarning) {
await acknowledgeHighBalanceWarning();
}
}

const moneyText = await elementByIdWithin('TotalBalance-primary', 'MoneyText');
await expect(moneyText).toHaveText(formattedSats);

if (driver.isIOS) {
await dismissBackupTimedSheet({ triggerTimedSheet: true });
if (expectHighBalanceWarning) {
await acknowledgeHighBalanceWarning({ triggerTimedSheet: true });
}
await dismissBackupTimedSheet({ triggerTimedSheet: true });
if (expectHighBalanceWarning) {
await acknowledgeHighBalanceWarning({ triggerTimedSheet: driver.isIOS });
}
}

Expand Down Expand Up @@ -887,7 +878,7 @@ export async function enterAddress(address: string, { acceptCameraPermission = t
await tap('Send');
await sleep(700);
if (acceptCameraPermission) {
await acceptAppNotificationAlert('permission_allow_one_time_button');
await handleAndroidAlert('permission_allow_one_time_button');
}
await tap('RecipientManual');
await typeAddressAndVerifyContinue({ address });
Expand All @@ -901,7 +892,7 @@ export async function enterAddressViaScanPrompt(
await tap('Scan');
await sleep(700);
if (acceptCameraPermission) {
await acceptAppNotificationAlert('permission_allow_foreground_only_button');
await handleAndroidAlert('permission_allow_foreground_only_button');
}
await tap('ScanPrompt');
await typeText('QRInput', address);
Expand Down
1 change: 1 addition & 0 deletions test/helpers/lnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export async function checkChannelStatus({ size = '100 000' } = {}) {
await tap('DrawerSettings');
await tap('AdvancedSettings');
await tap('Channels');
await sleep(1000);
await tap('Channel');
await expectTextWithin('TotalSize', `₿ ${size}`);
await swipeFullScreen('up');
Expand Down
2 changes: 1 addition & 1 deletion test/specs/lightning.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('@lightning - Lightning', () => {
await dismissBackgroundPaymentsTimedSheet({ triggerTimedSheet: driver.isIOS });
await dismissQuickPayIntro({ triggerTimedSheet: driver.isIOS });
} else {
await dismissQuickPayIntro();
await dismissQuickPayIntro({ triggerTimedSheet: true });
}
const totalBalance = await elementByIdWithin('TotalBalance-primary', 'MoneyText');
await expect(totalBalance).toHaveText('11 000'); // 1k onchain + 10k lightning
Expand Down
2 changes: 1 addition & 1 deletion test/specs/lnurl.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe('@lnurl - LNURL', () => {

// Success toast/flow
if (driver.isIOS) await waitForToast('SpendingBalanceReadyToast');
if (driver.isAndroid) await dismissQuickPayIntro();
if (driver.isAndroid) await dismissQuickPayIntro({ triggerTimedSheet: true });
await acknowledgeExternalSuccess();
if (driver.isIOS) {
await dismissBackgroundPaymentsTimedSheet();
Expand Down
6 changes: 3 additions & 3 deletions test/specs/onboarding.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
acceptAppNotificationAlert,
handleAndroidAlert,
confirmInputOnKeyboard,
elementById,
elementByText,
Expand Down Expand Up @@ -49,7 +49,7 @@ describe('@onboarding - Onboarding', () => {
await tap('NewWallet');
await waitForSetupWalletScreenFinish();

await acceptAppNotificationAlert();
await handleAndroidAlert();

await elementByText('TO GET').waitForDisplayed();
});
Expand Down Expand Up @@ -82,7 +82,7 @@ describe('@onboarding - Onboarding', () => {
await tap('CreateNewWallet');
await waitForSetupWalletScreenFinish();

await acceptAppNotificationAlert();
await handleAndroidAlert();

// Wait for wallet to be created
for (let i = 1; i <= 3; i++) {
Expand Down
9 changes: 2 additions & 7 deletions test/specs/onchain.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,16 @@ describe('@onchain - Onchain', () => {

await mineBlocks(rpc, 1);
await electrum?.waitForSync();

if (i === 1 && driver.isAndroid) {
await dismissBackupTimedSheet();
await acknowledgeHighBalanceWarning();
}
await sleep(1000); // wait for the app to settle

// - shows correct total balance
const totalBalance = await elementByIdWithin('TotalBalance-primary', 'MoneyText');
const expected = `${i}00 000 000`;
await expect(totalBalance).toHaveText(expected);

if (i === 1 && driver.isIOS) {
if (i === 1) {
await dismissBackupTimedSheet({ triggerTimedSheet: true });
await acknowledgeHighBalanceWarning({ triggerTimedSheet: true });
await acknowledgeHighBalanceWarning({ triggerTimedSheet: driver.isIOS });
}
}

Expand Down
6 changes: 3 additions & 3 deletions test/specs/send.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
dismissQuickPayIntro,
doNavigationClose,
waitForToast,
acceptAppNotificationAlert,
handleAndroidAlert,
dismissBackgroundPaymentsTimedSheet,
acknowledgeReceivedPayment,
} from '../helpers/actions';
Expand Down Expand Up @@ -67,7 +67,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 handleAndroidAlert('permission_allow_foreground_only_button');
await tap('RecipientManual');

// check validation for empty address
Expand Down Expand Up @@ -200,7 +200,7 @@ describe('@send - Send', () => {
await dismissBackgroundPaymentsTimedSheet({ triggerTimedSheet: driver.isIOS });
await dismissQuickPayIntro({ triggerTimedSheet: driver.isIOS });
} else {
await dismissQuickPayIntro();
await dismissQuickPayIntro({ triggerTimedSheet: true });
}

const totalBalance = await elementByIdWithin('TotalBalance-primary', 'MoneyText');
Expand Down
4 changes: 2 additions & 2 deletions test/specs/settings.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
dragOnElement,
elementsById,
getReceiveAddress,
acceptAppNotificationAlert,
handleAndroidAlert,
confirmInputOnKeyboard,
multiTap,
getAccessibleText,
Expand Down Expand Up @@ -437,7 +437,7 @@ describe('@settings - Settings', () => {
await tap('NavigationAction');
// on the first time we need to accept the notifications permission dialog to use camera
if (i === 0) {
await acceptAppNotificationAlert('permission_allow_foreground_only_button');
await handleAndroidAlert('permission_allow_foreground_only_button');
}
await tap('ScanPrompt');
await typeText('QRInput', conn.url);
Expand Down
2 changes: 1 addition & 1 deletion test/specs/transfer.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ describe('@transfer - Transfer', () => {
await dismissBackgroundPaymentsTimedSheet({ triggerTimedSheet: driver.isIOS });
await dismissQuickPayIntro({ triggerTimedSheet: driver.isIOS });
} else {
await dismissQuickPayIntro();
await dismissQuickPayIntro({ triggerTimedSheet: true });
}
await expectNoTextWithin('ActivitySpending', '0');
await waitForActiveChannel(lnd, ldkNodeId);
Expand Down