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
29 changes: 13 additions & 16 deletions test/specs/lnurl.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
enterAddressViaScanPrompt,
acknowledgeReceivedPayment,
acknowledgeExternalSuccess,
enterAmount,
} from '../helpers/actions';
import { reinstallApp } from '../helpers/setup';
import { ciIt } from '../helpers/suite';
Expand Down Expand Up @@ -177,27 +178,25 @@ describe('@lnurl - LNURL', () => {
await enterAddressViaScanPrompt(payRequest1.encoded, { acceptCameraPermission: false });
await expectTextWithin('SendNumberField', '0');
// Check that 149 sats is below minimum and 201 sats is above maximum (both rejected)
await tap('N2');
await tap('N0');
await tap('N1');
if (driver.isAndroid) {
await waitForToast('SendAmountExceededToast');
} else {
await elementById('ContinueAmount').waitForEnabled({ reverse: true });
try {
await enterAmount(201);
await waitForToast('SendAmountExceededToast', { dismiss: driver.isAndroid });
} catch {
console.warn('SendAmountExceededToast not triggered, trying again...');
// tap on 1 fast to trigger the toast
await elementById('N1').click();
await waitForToast('SendAmountExceededToast', { dismiss: driver.isAndroid });
}

await multiTap('NRemove', 3); // remove "201"
await tap('N1');
await tap('N4');
await tap('N9');
await enterAmount(149);
await expectTextWithin('SendNumberField', '149');
await tap('ContinueAmount');
await waitForToast('LnurlPayAmountTooLowToast');

await multiTap('NRemove', 3); // remove "149"
// go with 150
await tap('N1');
await tap('N5');
await tap('N0');
await enterAmount(150);
await expectTextWithin('SendNumberField', '150');
await elementById('ContinueAmount').waitForEnabled();
await tap('ContinueAmount');
Expand Down Expand Up @@ -264,9 +263,7 @@ describe('@lnurl - LNURL', () => {
await enterAddress(payRequest3.encoded, { acceptCameraPermission: false });
await expectTextWithin('SendNumberField', '0');
// go with 321
await tap('N3');
await tap('N2');
await tap('N1');
await enterAmount(321);
await elementById('ContinueAmount').waitForDisplayed();
await tap('ContinueAmount');
await dragOnElement('GRAB', 'right', 0.95);
Expand Down
16 changes: 12 additions & 4 deletions test/specs/send.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,12 @@ describe('@send - Send', () => {
// type amount over balance and verify you cannot continue
await tap('AddressContinue');
await enterAmount(amount + 1);
if (driver.isAndroid) {
try {
await waitForToast('SendAmountExceededToast');
} catch {
console.warn('SendAmountExceededToast not triggered, trying again...');
await elementById('N1').click();
await waitForToast('SendAmountExceededToast');
} else {
await elementById('ContinueAmount').waitForEnabled({ reverse: true });
}
await tap('NavigationBack');

Expand Down Expand Up @@ -267,7 +269,13 @@ describe('@send - Send', () => {
console.info({ invoice0 });
await enterAddress(invoice0);
await enterAmount(10_000 + 1);
await elementById('ContinueAmount').waitForEnabled({ reverse: true });
try {
await waitForToast('SendAmountExceededToast');
} catch {
console.warn('SendAmountExceededToast not triggered, trying again...');
await elementById('N1').click();
await waitForToast('SendAmountExceededToast');
}
await swipeFullScreen('down');

// send to onchain address
Expand Down