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
3 changes: 2 additions & 1 deletion test/helpers/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,8 @@ export type ToastId =
| 'ProfileUpdatedToast'
| 'ContactSavedToast'
| 'ContactUpdatedToast'
| 'ContactDeletedToast';
| 'ContactDeletedToast'
| 'SendAmountExceededToast';

/** Wait for a toast by test id. Prefer `waitToDisappear` for iOS: success toasts live in a separate
* window, so swipe-dismiss (`dismiss: true`) often uses wrong coordinates and blocks later UI. */
Expand Down
7 changes: 5 additions & 2 deletions test/specs/lnurl.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,11 @@ describe('@lnurl - LNURL', () => {
await tap('N2');
await tap('N0');
await tap('N1');
await expectTextWithin('SendNumberField', '201');
await elementById('ContinueAmount').waitForEnabled({ reverse: true });
if (driver.isAndroid) {
await waitForToast('SendAmountExceededToast');
} else {
await elementById('ContinueAmount').waitForEnabled({ reverse: true });
}
await multiTap('NRemove', 3); // remove "201"
await tap('N1');
await tap('N4');
Expand Down
16 changes: 6 additions & 10 deletions test/specs/numberpad.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('@numberpad - NumberPad', () => {
electrum = await initElectrum();
await reinstallApp();
await completeOnboarding();
await receiveOnchainFunds({ sats: 10_000 });
await receiveOnchainFunds({ sats: 500_000_000, expectHighBalanceWarning: true });
});

after(async () => {
Expand Down Expand Up @@ -89,11 +89,11 @@ async function modernDenominationChecks(mode: NumberpadMode) {

await tap('N000');
await expectText('123 000');
await checkContinueButton(mode, { aboveBalance: true });
await checkContinueButton(mode);

// Switch to USD
await tap(`${mode}NumberPadUnit`);
await checkContinueButton(mode, { aboveBalance: true });
await checkContinueButton(mode);

// reset to 0
await multiTap('NRemove', 8);
Expand All @@ -112,7 +112,7 @@ async function modernDenominationChecks(mode: NumberpadMode) {
await tap('NDecimal');
await tap('N1');
await expectText('1.01');
await checkContinueButton(mode, { aboveBalance: false });
await checkContinueButton(mode);

// Switch back to BTC
await tap(`${mode}NumberPadUnit`);
Expand Down Expand Up @@ -157,15 +157,11 @@ async function classicDenominationChecks(mode: NumberpadMode) {
}

async function checkContinueButton(
mode: NumberpadMode,
{ aboveBalance = true }: { aboveBalance?: boolean } = {}
mode: NumberpadMode
) {
if (mode === 'Send') {
// make sure Continue button is disabled as amount is above balance
if (driver.isAndroid) return; // https://github.com/synonymdev/bitkit-android/issues/611
await elementById('ContinueAmount').waitForEnabled({ reverse: aboveBalance });
await elementById('ContinueAmount').waitForEnabled();
} else {
// In receive mode Continue is always enabled
await elementById('ReceiveNumberPadSubmit').waitForEnabled();
}
}
Expand Down
6 changes: 5 additions & 1 deletion test/specs/send.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ describe('@send - Send', () => {
// type amount over balance and verify you cannot continue
await tap('AddressContinue');
await enterAmount(amount + 1);
await elementById('ContinueAmount').waitForEnabled({ reverse: true });
if (driver.isAndroid) {
await waitForToast('SendAmountExceededToast');
} else {
await elementById('ContinueAmount').waitForEnabled({ reverse: true });
}
await tap('NavigationBack');

// check validation for unified invoice when balance is enough (10_000 sats)
Expand Down
2 changes: 2 additions & 0 deletions test/specs/transfer.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ describe('@transfer - Transfer', () => {
const eurBalance = Number.parseInt(label, 10);
await expect(eurBalance).toBeGreaterThan(440);
await expect(eurBalance).toBeLessThan(460);
await sleep(1000);
await tap('SpendingAdvancedNumberField'); // change back to sats
await tap('SpendingAdvancedContinue');
await sleep(500);
Expand Down Expand Up @@ -163,6 +164,7 @@ describe('@transfer - Transfer', () => {
// Get another channel with custom receiving capacity
await tap('ActivitySavings');
await tap('TransferToSpending');
await elementById('SpendingAmountContinue').waitForEnabled();
await tap('N1');
await multiTap('N0', 5);
await tap('SpendingAmountContinue');
Expand Down