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
1 change: 1 addition & 0 deletions test/helpers/lnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export async function connectToLND(lndNodeID: string, { navigationClose = true }
await typeText('PortInput', '9735');
await confirmInputOnKeyboard();
await tap('ExternalContinue');
await sleep(1000);
if (navigationClose) await doNavigationClose();
}

Expand Down
27 changes: 17 additions & 10 deletions test/specs/lightning.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,13 @@ describe('@lightning - Lightning', () => {
// check channel status
await checkChannelStatus();

// send funds to LDK, 0 invoice
console.info('receive 10k sats from LND (non-edited invoice)');
const receive = await getReceiveAddress('lightning');
await swipeFullScreen('down');
const response = await lnd.sendPaymentSync({ paymentRequest: receive, amt: '10000' });
console.info({ response });
await elementById('ReceivedTransaction').waitForDisplayed();
await tap('ReceivedTransactionButton');
await sleep(1000);
await acknowledgeReceivedPayment();
await sleep(500);
if (driver.isIOS) {
await dismissBackgroundPaymentsTimedSheet({ triggerTimedSheet: driver.isIOS });
await dismissQuickPayIntro({ triggerTimedSheet: driver.isIOS });
Expand All @@ -127,7 +126,7 @@ describe('@lightning - Lightning', () => {
await expect(totalBalance).toHaveText('11 000'); // 1k onchain + 10k lightning
await expectTextWithin('ActivitySpending', '10 000');

// send funds to LDK, 111 sats invoice
console.info('receive 111 sats from LND, (edited invoice with amt=111, note and tag)');
await tap('Receive');
await sleep(1000);
await tap('SpecifyInvoiceButton');
Expand All @@ -148,36 +147,42 @@ describe('@lightning - Lightning', () => {
const invoice2 = await getAddressFromQRCode('lightning');
await swipeFullScreen('down');
await lnd.sendPaymentSync({ paymentRequest: invoice2 });
await elementById('ReceivedTransaction').waitForDisplayed();
await tap('ReceivedTransactionButton');
await acknowledgeReceivedPayment();
await sleep(500);
await expect(totalBalance).toHaveText('11 111'); // 1k onchain + 10 111 lightning
await expectTextWithin('ActivitySpending', '10 111');

// send funds to LND, 0 invoice
await console.info('send lightning payment (lightning invoice with no amount and note)');
const note2 = 'zero';
const { paymentRequest: invoice1 } = await lnd.addInvoice({
memo: note2,
});
await console.info({ invoice1 });
await enterAddress(invoice1);
await multiTap('N1', 3);
await tap('ContinueAmount');
await console.info('I can edit the amount on Review screen');
await tap('ReviewAmount-primary');
await tap('ContinueAmount');
await dragOnElement('GRAB', 'right', 0.95); // Swipe to confirm
await elementById('SendSuccess').waitForDisplayed();
await tap('Close');
await expect(totalBalance).toHaveText('11 000'); // 1k onchain + 10k lightning
await expectTextWithin('ActivitySpending', '10 000');

// send funds to LND, 10000 invoice
await console.info('send lightning payment (lightning invoice with amount = 1000) and manually added tag');
const value = '1000';
const { paymentRequest: invoice4 } = await lnd.addInvoice({
value: value,
});
await enterAddress(invoice4);
await console.info({ invoice4 });
await enterAddress(invoice4, { acceptCameraPermission: false });
// Review & Send
const reviewAmt = await elementByIdWithin('ReviewAmount-primary', 'MoneyText');
await reviewAmt.waitForDisplayed();
await expect(reviewAmt).toHaveText('1 000');
await console.info('I cannot edit the amount on Review screen');
await tap('ReviewAmount-primary');
await tap('TagsAddSend');
await typeText('TagInputSend', 'stag');
await tap('SendTagsSubmit');
Expand Down Expand Up @@ -234,13 +239,15 @@ describe('@lightning - Lightning', () => {
// filter by receive tag
await tap('Tab-all');
await tap('TagsPrompt');
await sleep(500);
await tap('Tag-rtag');
await expectTextWithin('Activity-1', '+');
await elementById('Activity-2').waitForDisplayed({ reverse: true });
await tap('Tag-rtag-delete');

// filter by send tag
await tap('TagsPrompt');
await sleep(500);
await tap('Tag-stag');
await expectTextWithin('Activity-1', '-');
await elementById('Activity-2').waitForDisplayed({ reverse: true });
Expand Down