diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index dfcb19a..b469e3e 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -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. */ diff --git a/test/specs/lnurl.e2e.ts b/test/specs/lnurl.e2e.ts index 5bae73b..14c3164 100644 --- a/test/specs/lnurl.e2e.ts +++ b/test/specs/lnurl.e2e.ts @@ -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'); diff --git a/test/specs/numberpad.e2e.ts b/test/specs/numberpad.e2e.ts index 9f548ca..50312ea 100644 --- a/test/specs/numberpad.e2e.ts +++ b/test/specs/numberpad.e2e.ts @@ -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 () => { @@ -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); @@ -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`); @@ -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(); } } diff --git a/test/specs/send.e2e.ts b/test/specs/send.e2e.ts index b9cf96c..c7efd67 100644 --- a/test/specs/send.e2e.ts +++ b/test/specs/send.e2e.ts @@ -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) diff --git a/test/specs/transfer.e2e.ts b/test/specs/transfer.e2e.ts index e7c9e6c..201b87b 100644 --- a/test/specs/transfer.e2e.ts +++ b/test/specs/transfer.e2e.ts @@ -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); @@ -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');