Skip to content

Commit 6ad327e

Browse files
authored
Merge pull request #90 from synonymdev/fix/uniffy-timed-sheet-behavior-for-master
Fix/uniffy timed sheet behavior for master
2 parents 1ba7b12 + fbfb8bf commit 6ad327e

9 files changed

Lines changed: 23 additions & 35 deletions

File tree

test/helpers/actions.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ export async function confirmInputOnKeyboard() {
446446
}
447447
}
448448

449-
export async function acceptAppNotificationAlert(
449+
export async function handleAndroidAlert(
450450
button: string = 'permission_allow_button'
451451
): Promise<void> {
452452
if (driver.isAndroid) {
@@ -503,7 +503,7 @@ export async function completeOnboarding({ isFirstTime = true } = {}) {
503503
await waitForSetupWalletScreenFinish();
504504

505505
if (isFirstTime) {
506-
await acceptAppNotificationAlert();
506+
await handleAndroidAlert();
507507
}
508508

509509
// Wait for wallet to be created
@@ -559,7 +559,7 @@ export async function restoreWallet(
559559
await tap('RestoreButton');
560560
await waitForSetupWalletScreenFinish();
561561

562-
await acceptAppNotificationAlert();
562+
await handleAndroidAlert();
563563

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

673673
await mineBlocks(rpc, blocksToMine);
674674

675-
if (driver.isAndroid) {
676-
await dismissBackupTimedSheet();
677-
if (expectHighBalanceWarning) {
678-
await acknowledgeHighBalanceWarning();
679-
}
680-
}
681-
682675
const moneyText = await elementByIdWithin('TotalBalance-primary', 'MoneyText');
683676
await expect(moneyText).toHaveText(formattedSats);
684677

685-
if (driver.isIOS) {
686-
await dismissBackupTimedSheet({ triggerTimedSheet: true });
687-
if (expectHighBalanceWarning) {
688-
await acknowledgeHighBalanceWarning({ triggerTimedSheet: true });
689-
}
678+
await dismissBackupTimedSheet({ triggerTimedSheet: true });
679+
if (expectHighBalanceWarning) {
680+
await acknowledgeHighBalanceWarning({ triggerTimedSheet: true });
690681
}
691682
}
692683

@@ -887,7 +878,7 @@ export async function enterAddress(address: string, { acceptCameraPermission = t
887878
await tap('Send');
888879
await sleep(700);
889880
if (acceptCameraPermission) {
890-
await acceptAppNotificationAlert('permission_allow_one_time_button');
881+
await handleAndroidAlert('permission_allow_one_time_button');
891882
}
892883
await tap('RecipientManual');
893884
await typeAddressAndVerifyContinue({ address });
@@ -901,7 +892,7 @@ export async function enterAddressViaScanPrompt(
901892
await tap('Scan');
902893
await sleep(700);
903894
if (acceptCameraPermission) {
904-
await acceptAppNotificationAlert('permission_allow_foreground_only_button');
895+
await handleAndroidAlert('permission_allow_foreground_only_button');
905896
}
906897
await tap('ScanPrompt');
907898
await typeText('QRInput', address);

test/helpers/lnd.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export async function checkChannelStatus({ size = '100 000' } = {}) {
127127
await tap('DrawerSettings');
128128
await tap('AdvancedSettings');
129129
await tap('Channels');
130+
await sleep(1000);
130131
await tap('Channel');
131132
await expectTextWithin('TotalSize', `₿ ${size}`);
132133
await swipeFullScreen('up');

test/specs/lightning.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ describe('@lightning - Lightning', () => {
116116
await dismissBackgroundPaymentsTimedSheet({ triggerTimedSheet: driver.isIOS });
117117
await dismissQuickPayIntro({ triggerTimedSheet: driver.isIOS });
118118
} else {
119-
await dismissQuickPayIntro();
119+
await dismissQuickPayIntro({ triggerTimedSheet: true });
120120
}
121121
const totalBalance = await elementByIdWithin('TotalBalance-primary', 'MoneyText');
122122
await expect(totalBalance).toHaveText('11 000'); // 1k onchain + 10k lightning

test/specs/lnurl.e2e.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,13 @@ describe('@lnurl - LNURL', () => {
141141
await waitForActiveChannel(lnd as any, ldkNodeID);
142142

143143
// Success toast/flow
144-
if (driver.isIOS) await waitForToast('SpendingBalanceReadyToast');
145-
if (driver.isAndroid) await dismissQuickPayIntro();
144+
await waitForToast('SpendingBalanceReadyToast');
146145
await acknowledgeExternalSuccess();
147146
if (driver.isIOS) {
148147
await dismissBackgroundPaymentsTimedSheet();
149148
await dismissQuickPayIntro({ triggerTimedSheet: driver.isIOS });
149+
} else {
150+
await dismissQuickPayIntro({ triggerTimedSheet: driver.isAndroid });
150151
}
151152
await expectTextWithin('ActivitySpending', '20 001');
152153

test/specs/onboarding.e2e.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
acceptAppNotificationAlert,
2+
handleAndroidAlert,
33
confirmInputOnKeyboard,
44
elementById,
55
elementByText,
@@ -43,7 +43,7 @@ describe('@onboarding - Onboarding', () => {
4343
await tap('NewWallet');
4444
await waitForSetupWalletScreenFinish();
4545

46-
await acceptAppNotificationAlert();
46+
await handleAndroidAlert();
4747

4848
await elementByText('TO GET').waitForDisplayed();
4949
});
@@ -70,7 +70,7 @@ describe('@onboarding - Onboarding', () => {
7070
await tap('CreateNewWallet');
7171
await waitForSetupWalletScreenFinish();
7272

73-
await acceptAppNotificationAlert();
73+
await handleAndroidAlert();
7474

7575
// Wait for wallet to be created
7676
for (let i = 1; i <= 3; i++) {

test/specs/onchain.e2e.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,14 @@ describe('@onchain - Onchain', () => {
129129

130130
await mineBlocks(rpc, 1);
131131
await electrum?.waitForSync();
132-
133-
if (i === 1 && driver.isAndroid) {
134-
await dismissBackupTimedSheet();
135-
await acknowledgeHighBalanceWarning();
136-
}
137132
await sleep(1000); // wait for the app to settle
138133

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

144-
if (i === 1 && driver.isIOS) {
139+
if (i === 1) {
145140
await dismissBackupTimedSheet({ triggerTimedSheet: true });
146141
await acknowledgeHighBalanceWarning({ triggerTimedSheet: true });
147142
}

test/specs/send.e2e.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
dismissQuickPayIntro,
2222
doNavigationClose,
2323
waitForToast,
24-
acceptAppNotificationAlert,
24+
handleAndroidAlert,
2525
dismissBackgroundPaymentsTimedSheet,
2626
acknowledgeReceivedPayment,
2727
} from '../helpers/actions';
@@ -67,7 +67,7 @@ describe('@send - Send', () => {
6767

6868
ciIt('@send_1 - Validates payment data in the manual input', async () => {
6969
await tap('Send');
70-
await acceptAppNotificationAlert('permission_allow_foreground_only_button');
70+
await handleAndroidAlert('permission_allow_foreground_only_button');
7171
await tap('RecipientManual');
7272

7373
// check validation for empty address
@@ -200,7 +200,7 @@ describe('@send - Send', () => {
200200
await dismissBackgroundPaymentsTimedSheet({ triggerTimedSheet: driver.isIOS });
201201
await dismissQuickPayIntro({ triggerTimedSheet: driver.isIOS });
202202
} else {
203-
await dismissQuickPayIntro();
203+
await dismissQuickPayIntro({ triggerTimedSheet: true });
204204
}
205205

206206
const totalBalance = await elementByIdWithin('TotalBalance-primary', 'MoneyText');

test/specs/settings.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
dragOnElement,
1111
elementsById,
1212
getReceiveAddress,
13-
acceptAppNotificationAlert,
13+
handleAndroidAlert,
1414
confirmInputOnKeyboard,
1515
multiTap,
1616
getAccessibleText,
@@ -437,7 +437,7 @@ describe('@settings - Settings', () => {
437437
await tap('NavigationAction');
438438
// on the first time we need to accept the notifications permission dialog to use camera
439439
if (i === 0) {
440-
await acceptAppNotificationAlert('permission_allow_foreground_only_button');
440+
await handleAndroidAlert('permission_allow_foreground_only_button');
441441
}
442442
await tap('ScanPrompt');
443443
await typeText('QRInput', conn.url);

test/specs/transfer.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ describe('@transfer - Transfer', () => {
347347
await dismissBackgroundPaymentsTimedSheet({ triggerTimedSheet: driver.isIOS });
348348
await dismissQuickPayIntro({ triggerTimedSheet: driver.isIOS });
349349
} else {
350-
await dismissQuickPayIntro();
350+
await dismissQuickPayIntro({ triggerTimedSheet: true });
351351
}
352352
await expectNoTextWithin('ActivitySpending', '0');
353353
await waitForActiveChannel(lnd, ldkNodeId);

0 commit comments

Comments
 (0)