From 4aadafb7d0bf86a52dfeb370f020e4767dc2d4f9 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 26 Nov 2025 19:30:08 +0100 Subject: [PATCH 01/50] acceptReceivedPayment for onchain payments --- test/helpers/actions.ts | 14 ++++++++++---- test/specs/lightning.e2e.ts | 5 ++--- test/specs/onchain.e2e.ts | 9 +++++---- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index c754058..487f9d0 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -626,6 +626,12 @@ export async function mineBlocks(rpc: BitcoinJsonRpc, blocks: number = 1) { } } +export async function acceptReceivedPayment() { + await elementById('ReceivedTransaction').waitForDisplayed(); + await tap('ReceivedTransactionButton'); + await sleep(300); +} + export async function receiveOnchainFunds( rpc: BitcoinJsonRpc, { @@ -647,11 +653,11 @@ export async function receiveOnchainFunds( const address = await getReceiveAddress(); await swipeFullScreen('down'); await rpc.sendToAddress(address, btc); - await mineBlocks(rpc, blocksToMine); - // https://github.com/synonymdev/bitkit-android/issues/268 - // send - onchain - receiver sees no confetti — missing-in-ldk-node missing onchain payment event - // await elementById('ReceivedTransaction').waitForDisplayed(); + await acceptReceivedPayment(); + + await mineBlocks(rpc, blocksToMine); + await expectText('Payment Confirmed'); if (driver.isAndroid) { await dismissBackupTimedSheet(); diff --git a/test/specs/lightning.e2e.ts b/test/specs/lightning.e2e.ts index 028f68b..32e9c82 100644 --- a/test/specs/lightning.e2e.ts +++ b/test/specs/lightning.e2e.ts @@ -23,6 +23,7 @@ import { elementByText, dismissQuickPayIntro, doNavigationClose, + acceptReceivedPayment, } from '../helpers/actions'; import { reinstallApp } from '../helpers/setup'; import { bitcoinURL, lndConfig } from '../helpers/constants'; @@ -273,9 +274,7 @@ describe('@lightning - Lightning', () => { await mineBlocks(rpc, 6); await electrum?.waitForSync(); - // https://github.com/synonymdev/bitkit-android/issues/268 - // send - onchain - receiver sees no confetti — missing-in-ldk-node missing onchain payment event - // await elementById('ReceivedTransaction').waitForDisplayed(); + await acceptReceivedPayment(); await elementById('Channel').waitForDisplayed({ reverse: true }); await tap('NavigationBack'); await doNavigationClose(); diff --git a/test/specs/onchain.e2e.ts b/test/specs/onchain.e2e.ts index 667b857..d3d7256 100644 --- a/test/specs/onchain.e2e.ts +++ b/test/specs/onchain.e2e.ts @@ -24,6 +24,8 @@ import { dismissBackupTimedSheet, handleOver50PercentAlert, handleOver100Alert, + acceptReceivedPayment, + expectText, } from '../helpers/actions'; import { ciIt } from '../helpers/suite'; @@ -124,12 +126,11 @@ describe('@onchain - Onchain', () => { await swipeFullScreen('down'); await rpc.sendToAddress(address, '1'); + await acceptReceivedPayment(); + await mineBlocks(rpc, 1); await electrum?.waitForSync(); - - // https://github.com/synonymdev/bitkit-android/issues/268 - // send - onchain - receiver sees no confetti — missing-in-ldk-node missing onchain payment event - // await elementById('ReceivedTransaction').waitForDisplayed(); + await expectText('Payment Confirmed'); if (i === 1 && driver.isAndroid) { await dismissBackupTimedSheet(); From f126c88a313c0ea11f152462680fa8e46251fbd5 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 26 Nov 2025 22:11:38 +0100 Subject: [PATCH 02/50] adjust PaymentConfirmedToast --- test/helpers/actions.ts | 4 +++- test/specs/onchain.e2e.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 487f9d0..8fd4257 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -657,7 +657,9 @@ export async function receiveOnchainFunds( await acceptReceivedPayment(); await mineBlocks(rpc, blocksToMine); - await expectText('Payment Confirmed'); + if (blocksToMine > 0) { + await elementById('PaymentConfirmedToast').waitForDisplayed(); + } if (driver.isAndroid) { await dismissBackupTimedSheet(); diff --git a/test/specs/onchain.e2e.ts b/test/specs/onchain.e2e.ts index d3d7256..5741436 100644 --- a/test/specs/onchain.e2e.ts +++ b/test/specs/onchain.e2e.ts @@ -130,7 +130,7 @@ describe('@onchain - Onchain', () => { await mineBlocks(rpc, 1); await electrum?.waitForSync(); - await expectText('Payment Confirmed'); + await elementById('PaymentConfirmedToast').waitForDisplayed(); if (i === 1 && driver.isAndroid) { await dismissBackupTimedSheet(); From a15e8c5b813e3aab0391e2600de819dde8ce6c99 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 26 Nov 2025 22:14:25 +0100 Subject: [PATCH 03/50] acknowledgeReceivedPayment --- test/helpers/actions.ts | 16 +++++++++------- test/specs/lightning.e2e.ts | 4 ++-- test/specs/onchain.e2e.ts | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 8fd4257..be91f2f 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -626,12 +626,6 @@ export async function mineBlocks(rpc: BitcoinJsonRpc, blocks: number = 1) { } } -export async function acceptReceivedPayment() { - await elementById('ReceivedTransaction').waitForDisplayed(); - await tap('ReceivedTransactionButton'); - await sleep(300); -} - export async function receiveOnchainFunds( rpc: BitcoinJsonRpc, { @@ -654,7 +648,7 @@ export async function receiveOnchainFunds( await swipeFullScreen('down'); await rpc.sendToAddress(address, btc); - await acceptReceivedPayment(); + await acknowledgeReceivedPayment(); await mineBlocks(rpc, blocksToMine); if (blocksToMine > 0) { @@ -679,6 +673,14 @@ export async function receiveOnchainFunds( } } +/** Acknowledges the received payment notification by tapping the button. + */ +export async function acknowledgeReceivedPayment() { + await elementById('ReceivedTransaction').waitForDisplayed(); + await tap('ReceivedTransactionButton'); + await sleep(300); +} + /** * Triggers the timed backup sheet by navigating to settings and back. * Since timed sheets are sometimes triggered by user behavior (when user goes back to home screen), diff --git a/test/specs/lightning.e2e.ts b/test/specs/lightning.e2e.ts index 32e9c82..c4b2041 100644 --- a/test/specs/lightning.e2e.ts +++ b/test/specs/lightning.e2e.ts @@ -23,7 +23,7 @@ import { elementByText, dismissQuickPayIntro, doNavigationClose, - acceptReceivedPayment, + acknowledgeReceivedPayment, } from '../helpers/actions'; import { reinstallApp } from '../helpers/setup'; import { bitcoinURL, lndConfig } from '../helpers/constants'; @@ -274,7 +274,7 @@ describe('@lightning - Lightning', () => { await mineBlocks(rpc, 6); await electrum?.waitForSync(); - await acceptReceivedPayment(); + await acknowledgeReceivedPayment(); await elementById('Channel').waitForDisplayed({ reverse: true }); await tap('NavigationBack'); await doNavigationClose(); diff --git a/test/specs/onchain.e2e.ts b/test/specs/onchain.e2e.ts index 5741436..16ebd20 100644 --- a/test/specs/onchain.e2e.ts +++ b/test/specs/onchain.e2e.ts @@ -24,7 +24,7 @@ import { dismissBackupTimedSheet, handleOver50PercentAlert, handleOver100Alert, - acceptReceivedPayment, + acknowledgeReceivedPayment, expectText, } from '../helpers/actions'; import { ciIt } from '../helpers/suite'; @@ -126,7 +126,7 @@ describe('@onchain - Onchain', () => { await swipeFullScreen('down'); await rpc.sendToAddress(address, '1'); - await acceptReceivedPayment(); + await acknowledgeReceivedPayment(); await mineBlocks(rpc, 1); await electrum?.waitForSync(); From fddb498a26c88b2cbd70e11b843eb32f0b406c49 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 27 Nov 2025 10:46:37 +0100 Subject: [PATCH 04/50] waitForToast --- test/helpers/actions.ts | 15 ++++++++++++++- test/specs/boost.e2e.ts | 19 +++++++++++-------- test/specs/onchain.e2e.ts | 4 ++-- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index be91f2f..9c21b03 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -652,7 +652,7 @@ export async function receiveOnchainFunds( await mineBlocks(rpc, blocksToMine); if (blocksToMine > 0) { - await elementById('PaymentConfirmedToast').waitForDisplayed(); + await waitForToast('PaymentConfirmedToast'); } if (driver.isAndroid) { @@ -673,6 +673,19 @@ export async function receiveOnchainFunds( } } +type ToastId = + | 'PaymentConfirmedToast' + | 'PaymentFailedToast' + | 'TransactionConfirmedToast' + | 'ReceivedTransactionReplacedToast' + | 'TransactionReplacedToast' + | 'TransactionUnconfirmedToast' + | 'TransactionRemovedToast'; + +export async function waitForToast(toastId: ToastId) { + await elementById(toastId).waitForDisplayed(); +} + /** Acknowledges the received payment notification by tapping the button. */ export async function acknowledgeReceivedPayment() { diff --git a/test/specs/boost.e2e.ts b/test/specs/boost.e2e.ts index 2708399..617c51c 100644 --- a/test/specs/boost.e2e.ts +++ b/test/specs/boost.e2e.ts @@ -20,6 +20,7 @@ import { getSeed, waitForBackup, restoreWallet, + waitForToast, } from '../helpers/actions'; import { bitcoinURL } from '../helpers/constants'; import initElectrum from '../helpers/electrum'; @@ -268,20 +269,22 @@ describe('@boost - Boost', () => { await elementById('StatusBoosting').waitForDisplayed(); await doNavigationClose(); await tap('ActivityShort-1'); - await elementById('BoostedButton').waitForDisplayed(); await elementById('StatusRemoved').waitForDisplayed(); // mine new block await mineBlocks(rpc, 1); - - // check activity item after mine - // TEMP: refresh until proper events available + await waitForToast('TransactionConfirmedToast'); await doNavigationClose(); await sleep(500); - await swipeFullScreen('down'); - await attemptRefreshOnHomeScreen(); - await swipeFullScreen('up'); - // TEMP: refresh until proper events available + + if (driver.isAndroid) { + // TEMP: refresh until proper events available + await swipeFullScreen('down'); + await attemptRefreshOnHomeScreen(); + await swipeFullScreen('up'); + // TEMP: refresh until proper events available + } + // check activity item after mine await elementById('ActivityShort-0').waitForDisplayed(); await tap('ActivityShort-0'); await elementById('StatusConfirmed').waitForDisplayed(); diff --git a/test/specs/onchain.e2e.ts b/test/specs/onchain.e2e.ts index 16ebd20..2fb78db 100644 --- a/test/specs/onchain.e2e.ts +++ b/test/specs/onchain.e2e.ts @@ -25,7 +25,7 @@ import { handleOver50PercentAlert, handleOver100Alert, acknowledgeReceivedPayment, - expectText, + waitForToast, } from '../helpers/actions'; import { ciIt } from '../helpers/suite'; @@ -130,7 +130,7 @@ describe('@onchain - Onchain', () => { await mineBlocks(rpc, 1); await electrum?.waitForSync(); - await elementById('PaymentConfirmedToast').waitForDisplayed(); + await waitForToast('PaymentConfirmedToast'); if (i === 1 && driver.isAndroid) { await dismissBackupTimedSheet(); From 1429c64f5a9809a35ac79a3494356f20b3a32b12 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 27 Nov 2025 11:09:26 +0100 Subject: [PATCH 05/50] temp adjust boost_1 --- test/specs/boost.e2e.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/specs/boost.e2e.ts b/test/specs/boost.e2e.ts index 617c51c..6331b9c 100644 --- a/test/specs/boost.e2e.ts +++ b/test/specs/boost.e2e.ts @@ -84,7 +84,7 @@ describe('@boost - Boost', () => { // no additional boost tx item on iOS, there is one on Android // https://github.com/synonymdev/bitkit-android/issues/463 - const showsBoostTxItem = driver.isAndroid; + const showsBoostTxItem = driver.isAndroid || driver.isIOS; if (showsBoostTxItem) { await expect(elementById('ActivityShort-1')).toBeDisplayed(); await expect(elementById('ActivityShort-2')).not.toBeDisplayed(); @@ -144,19 +144,21 @@ describe('@boost - Boost', () => { // mine new block await mineBlocks(rpc, 1); - - // check activity item after mine - // TEMP: refresh until proper events available + await waitForToast('TransactionConfirmedToast'); await doNavigationClose(); await sleep(500); + + // TEMP: refresh until proper events available await swipeFullScreen('down'); await attemptRefreshOnHomeScreen(); await swipeFullScreen('up'); + // TEMP: refresh until proper events available + + // check activity item after mine await elementById('ActivityShort-0').waitForDisplayed(); if (showsBoostTxItem) { await elementById('ActivityShort-1').waitForDisplayed(); } - // TEMP: refresh until proper events available await tap('ActivityShort-0'); await elementById('StatusConfirmed').waitForDisplayed(); From 4d605ce96317ff1396b70e20b38ac6d55826b282 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 27 Nov 2025 11:10:15 +0100 Subject: [PATCH 06/50] remove refresh in boost --- test/specs/boost.e2e.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/test/specs/boost.e2e.ts b/test/specs/boost.e2e.ts index 6331b9c..08b48df 100644 --- a/test/specs/boost.e2e.ts +++ b/test/specs/boost.e2e.ts @@ -148,12 +148,6 @@ describe('@boost - Boost', () => { await doNavigationClose(); await sleep(500); - // TEMP: refresh until proper events available - await swipeFullScreen('down'); - await attemptRefreshOnHomeScreen(); - await swipeFullScreen('up'); - // TEMP: refresh until proper events available - // check activity item after mine await elementById('ActivityShort-0').waitForDisplayed(); if (showsBoostTxItem) { @@ -279,13 +273,6 @@ describe('@boost - Boost', () => { await doNavigationClose(); await sleep(500); - if (driver.isAndroid) { - // TEMP: refresh until proper events available - await swipeFullScreen('down'); - await attemptRefreshOnHomeScreen(); - await swipeFullScreen('up'); - // TEMP: refresh until proper events available - } // check activity item after mine await elementById('ActivityShort-0').waitForDisplayed(); await tap('ActivityShort-0'); From 94684a567daef8c31d34027e8c8b352f2760a165 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 27 Nov 2025 14:03:54 +0100 Subject: [PATCH 07/50] remove PaymentConfirmedToast and TransactionConfirmedToast --- test/helpers/actions.ts | 11 +++++------ test/specs/boost.e2e.ts | 4 ---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 9c21b03..b8c2683 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -651,9 +651,9 @@ export async function receiveOnchainFunds( await acknowledgeReceivedPayment(); await mineBlocks(rpc, blocksToMine); - if (blocksToMine > 0) { - await waitForToast('PaymentConfirmedToast'); - } + // if (blocksToMine > 0) { + // await waitForToast('PaymentConfirmedToast'); + // } if (driver.isAndroid) { await dismissBackupTimedSheet(); @@ -674,14 +674,13 @@ export async function receiveOnchainFunds( } type ToastId = - | 'PaymentConfirmedToast' + | 'PaymentConfirmedToast' // removed + | 'TransactionConfirmedToast' //removed | 'PaymentFailedToast' - | 'TransactionConfirmedToast' | 'ReceivedTransactionReplacedToast' | 'TransactionReplacedToast' | 'TransactionUnconfirmedToast' | 'TransactionRemovedToast'; - export async function waitForToast(toastId: ToastId) { await elementById(toastId).waitForDisplayed(); } diff --git a/test/specs/boost.e2e.ts b/test/specs/boost.e2e.ts index 08b48df..b9332cc 100644 --- a/test/specs/boost.e2e.ts +++ b/test/specs/boost.e2e.ts @@ -15,12 +15,10 @@ import { elementByIdWithin, getTextUnder, mineBlocks, - attemptRefreshOnHomeScreen, doNavigationClose, getSeed, waitForBackup, restoreWallet, - waitForToast, } from '../helpers/actions'; import { bitcoinURL } from '../helpers/constants'; import initElectrum from '../helpers/electrum'; @@ -144,7 +142,6 @@ describe('@boost - Boost', () => { // mine new block await mineBlocks(rpc, 1); - await waitForToast('TransactionConfirmedToast'); await doNavigationClose(); await sleep(500); @@ -269,7 +266,6 @@ describe('@boost - Boost', () => { // mine new block await mineBlocks(rpc, 1); - await waitForToast('TransactionConfirmedToast'); await doNavigationClose(); await sleep(500); From dfaefee64e87221ea51f24d6ce6114d8933a1007 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 27 Nov 2025 16:44:04 +0100 Subject: [PATCH 08/50] update toast ids --- test/helpers/actions.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index b8c2683..e6109d8 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -674,13 +674,12 @@ export async function receiveOnchainFunds( } type ToastId = - | 'PaymentConfirmedToast' // removed - | 'TransactionConfirmedToast' //removed | 'PaymentFailedToast' | 'ReceivedTransactionReplacedToast' | 'TransactionReplacedToast' | 'TransactionUnconfirmedToast' | 'TransactionRemovedToast'; + export async function waitForToast(toastId: ToastId) { await elementById(toastId).waitForDisplayed(); } From 1cbd12bd9f258f4b963fc5abd9deb3792b36fc9c Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 27 Nov 2025 16:44:19 +0100 Subject: [PATCH 09/50] update RBF --- test/specs/boost.e2e.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/test/specs/boost.e2e.ts b/test/specs/boost.e2e.ts index b9332cc..bd9083a 100644 --- a/test/specs/boost.e2e.ts +++ b/test/specs/boost.e2e.ts @@ -227,11 +227,10 @@ describe('@boost - Boost', () => { await elementById('BoostingIcon').waitForDisplayed(); await elementById('ActivityShort-0').waitForDisplayed(); await elementById('ActivityShort-1').waitForDisplayed(); - await elementById('ActivityShort-2').waitForDisplayed(); + await expect(elementById('ActivityShort-2')).not.toBeDisplayed(); await expectTextWithin('ActivityShort-0', '-'); - await expectTextWithin('ActivityShort-1', '-'); - await expectTextWithin('ActivityShort-2', '100 000'); - await expectTextWithin('ActivityShort-2', '+'); + await expectTextWithin('ActivityShort-1', '100 000'); + await expectTextWithin('ActivityShort-1', '+'); // new tx await tap('ActivityShort-0'); @@ -256,13 +255,10 @@ describe('@boost - Boost', () => { // check activity after restore await swipeFullScreen('up'); (await elementByIdWithin('ActivityShort-0', 'BoostingIcon')).waitForDisplayed(); - (await elementByIdWithin('ActivityShort-1', 'BoostingIcon')).waitForDisplayed(); await tap('ActivityShort-0'); await elementById('BoostedButton').waitForDisplayed(); await elementById('StatusBoosting').waitForDisplayed(); await doNavigationClose(); - await tap('ActivityShort-1'); - await elementById('StatusRemoved').waitForDisplayed(); // mine new block await mineBlocks(rpc, 1); @@ -274,8 +270,5 @@ describe('@boost - Boost', () => { await tap('ActivityShort-0'); await elementById('StatusConfirmed').waitForDisplayed(); await doNavigationClose(); - (await elementByIdWithin('ActivityShort-1', 'BoostingIcon')).waitForDisplayed(); - await tap('ActivityShort-1'); - await elementById('StatusRemoved').waitForDisplayed(); }); }); From ba705e0156d3aeef77b2071d80287066eaf13cea Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 27 Nov 2025 17:05:46 +0100 Subject: [PATCH 10/50] onchain PaymentConfirmedToast --- test/specs/onchain.e2e.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/specs/onchain.e2e.ts b/test/specs/onchain.e2e.ts index 2fb78db..8c96a64 100644 --- a/test/specs/onchain.e2e.ts +++ b/test/specs/onchain.e2e.ts @@ -25,7 +25,6 @@ import { handleOver50PercentAlert, handleOver100Alert, acknowledgeReceivedPayment, - waitForToast, } from '../helpers/actions'; import { ciIt } from '../helpers/suite'; @@ -130,7 +129,6 @@ describe('@onchain - Onchain', () => { await mineBlocks(rpc, 1); await electrum?.waitForSync(); - await waitForToast('PaymentConfirmedToast'); if (i === 1 && driver.isAndroid) { await dismissBackupTimedSheet(); From b4fc769efc3f85a2e359bff36c9dd73e0b380ef9 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 27 Nov 2025 20:50:46 +0100 Subject: [PATCH 11/50] adjust CPFP --- test/specs/boost.e2e.ts | 61 ++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 41 deletions(-) diff --git a/test/specs/boost.e2e.ts b/test/specs/boost.e2e.ts index bd9083a..c5bb101 100644 --- a/test/specs/boost.e2e.ts +++ b/test/specs/boost.e2e.ts @@ -79,25 +79,16 @@ describe('@boost - Boost', () => { // check Activity await elementById('BoostingIcon').waitForDisplayed(); await elementById('ActivityShort-0').waitForDisplayed(); - - // no additional boost tx item on iOS, there is one on Android - // https://github.com/synonymdev/bitkit-android/issues/463 - const showsBoostTxItem = driver.isAndroid || driver.isIOS; - if (showsBoostTxItem) { - await expect(elementById('ActivityShort-1')).toBeDisplayed(); - await expect(elementById('ActivityShort-2')).not.toBeDisplayed(); - } else { - await expect(elementById('ActivityShort-1')).not.toBeDisplayed(); - await expect(elementById('ActivityShort-2')).not.toBeDisplayed(); - } + await elementById('ActivityShort-1').waitForDisplayed(); + await expect(elementById('ActivityShort-2')).not.toBeDisplayed(); + await expectTextWithin('ActivityShort-0', '-'); + await expectTextWithin('ActivityShort-0', 'Boost Fee'); + await expectTextWithin('ActivityShort-1', '100 000'); + await expectTextWithin('ActivityShort-1', '+'); // orig tx still there await swipeFullScreen('up'); - if (showsBoostTxItem) { - await tap('ActivityShort-1'); - } else { - await tap('ActivityShort-0'); - } + await tap('ActivityShort-1'); await expectText('100 000', { strategy: 'contains' }); await elementById('BoostedButton').waitForDisplayed(); await elementById('StatusBoosting').waitForDisplayed(); @@ -110,17 +101,14 @@ describe('@boost - Boost', () => { console.info({ parentTxId }); await doNavigationClose(); - if (showsBoostTxItem) { - // new tx - await tap('ActivityShort-0'); - await tap('ActivityTxDetails'); - const boostTxId = await getTextUnder('TXID'); - console.info({ newTxId: boostTxId }); - await expect(origTxId !== boostTxId).toBe(true); - // TODO: not implemented yet - // await expect(boostTxId === parentTxId).toBe(true); - await doNavigationClose(); - } + // new tx: Boost Fee + await tap('ActivityShort-0'); + await tap('ActivityTxDetails'); + const boostTxId = await getTextUnder('TXID'); + console.info({ newTxId: boostTxId }); + await expect(origTxId !== boostTxId).toBe(true); + await expect(boostTxId === parentTxId).toBe(true); + await doNavigationClose(); // wipe & restore const seed = await getSeed(); @@ -130,13 +118,8 @@ describe('@boost - Boost', () => { // check activity after restore await swipeFullScreen('up'); await elementById('BoostingIcon').waitForDisplayed(); - if (showsBoostTxItem) { - await elementById('ActivityShort-1').waitForDisplayed(); - await tap('ActivityShort-1'); - } else { - await elementById('ActivityShort-0').waitForDisplayed(); - await tap('ActivityShort-0'); - } + await elementById('ActivityShort-1').waitForDisplayed(); + await tap('ActivityShort-1'); await elementById('BoostedButton').waitForDisplayed(); await elementById('StatusBoosting').waitForDisplayed(); @@ -147,17 +130,13 @@ describe('@boost - Boost', () => { // check activity item after mine await elementById('ActivityShort-0').waitForDisplayed(); - if (showsBoostTxItem) { - await elementById('ActivityShort-1').waitForDisplayed(); - } + await elementById('ActivityShort-1').waitForDisplayed(); await tap('ActivityShort-0'); await elementById('StatusConfirmed').waitForDisplayed(); await doNavigationClose(); - if (showsBoostTxItem) { - await tap('ActivityShort-1'); - await elementById('StatusConfirmed').waitForDisplayed(); - } + await tap('ActivityShort-1'); + await elementById('StatusConfirmed').waitForDisplayed(); }); ciIt('@boost_2 - Can do RBF', async () => { From 96ff42cf127c5b558f8d3c0997062fb8437a187a Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 28 Nov 2025 09:54:38 +0100 Subject: [PATCH 12/50] transfer_1 stability --- test/specs/transfer.e2e.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/specs/transfer.e2e.ts b/test/specs/transfer.e2e.ts index 67feb82..d6cac74 100644 --- a/test/specs/transfer.e2e.ts +++ b/test/specs/transfer.e2e.ts @@ -87,7 +87,7 @@ describe('@transfer - Transfer', () => { await tap('TransferIntro-button'); await tap('FundTransfer'); await tap('SpendingIntro-button'); - await sleep(1000); // let the animation finish + await sleep(3000); // let the animation finish //--- skip due to: https://github.com/synonymdev/bitkit-android/issues/425 ---// //// can continue with default client balance (0) @@ -118,6 +118,7 @@ describe('@transfer - Transfer', () => { //--- skip due to: https://github.com/synonymdev/bitkit-android/issues/424 ---// // can continue with 25% client balance + await elementById('SpendingAmountQuarter').waitForEnabled(); await tap('SpendingAmountQuarter'); await elementById('SpendingAmountContinue').waitForEnabled(); await sleep(500); From 00c5fa08f88d8ce6b0666b6a6dc0fcc3c9874a4d Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 28 Nov 2025 13:59:34 +0100 Subject: [PATCH 13/50] lightning stability sleep --- test/specs/lightning.e2e.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/test/specs/lightning.e2e.ts b/test/specs/lightning.e2e.ts index c4b2041..cd92c45 100644 --- a/test/specs/lightning.e2e.ts +++ b/test/specs/lightning.e2e.ts @@ -131,6 +131,7 @@ describe('@lightning - Lightning', () => { await tap('ReceiveTagsSubmit'); await sleep(300); await tap('ShowQrReceive'); + await sleep(500); const invoice2 = await getAddressFromQRCode('lightning'); await swipeFullScreen('down'); await lnd.sendPaymentSync({ paymentRequest: invoice2 }); From 3bfcbf488b1b55cbfafa087eec208a632b5b93d1 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 28 Nov 2025 16:28:18 +0100 Subject: [PATCH 14/50] lightning adjustments + stability --- test/helpers/lnd.ts | 1 + test/specs/lightning.e2e.ts | 4 +++- test/specs/numberpad.e2e.ts | 2 ++ test/specs/settings.e2e.ts | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/test/helpers/lnd.ts b/test/helpers/lnd.ts index d8242c2..fb8056b 100644 --- a/test/helpers/lnd.ts +++ b/test/helpers/lnd.ts @@ -103,6 +103,7 @@ export async function getLDKNodeID(): Promise { await elementById('LDKNodeID').waitForDisplayed({ timeout: 60_000 }); const ldkNodeId = (await elementById('LDKNodeID').getText()).trim(); console.info({ ldkNodeId }); + await sleep(500); await tap('NavigationBack'); return ldkNodeId; } diff --git a/test/specs/lightning.e2e.ts b/test/specs/lightning.e2e.ts index cd92c45..d6161d3 100644 --- a/test/specs/lightning.e2e.ts +++ b/test/specs/lightning.e2e.ts @@ -98,6 +98,7 @@ describe('@lightning - Lightning', () => { // Toast message await expectText('Spending Balance Ready'); + await expectText('Spending Balance Ready', { visible: false }); // check channel status await checkChannelStatus(); @@ -117,6 +118,7 @@ describe('@lightning - Lightning', () => { // send funds to LDK, 111 sats invoice await tap('Receive'); + await sleep(1000); await tap('SpecifyInvoiceButton'); await tap('ReceiveNumberPadTextField'); await sleep(100); @@ -270,12 +272,12 @@ describe('@lightning - Lightning', () => { // close channel await tap('CloseConnection'); await tap('CloseConnectionButton'); + await acknowledgeReceivedPayment(); await elementByText('Transfer Initiated').waitForDisplayed(); await elementByText('Transfer Initiated').waitForDisplayed({ reverse: true }); await mineBlocks(rpc, 6); await electrum?.waitForSync(); - await acknowledgeReceivedPayment(); await elementById('Channel').waitForDisplayed({ reverse: true }); await tap('NavigationBack'); await doNavigationClose(); diff --git a/test/specs/numberpad.e2e.ts b/test/specs/numberpad.e2e.ts index 2da5a7e..7cadef3 100644 --- a/test/specs/numberpad.e2e.ts +++ b/test/specs/numberpad.e2e.ts @@ -24,6 +24,7 @@ describe('@numberpad - NumberPad', () => { describe('Modern denomination', () => { ciIt('@numberpad_1 - Receive: Can enter amounts in modern denomination', async () => { await tap('Receive'); + await sleep(700); await tap('SpecifyInvoiceButton'); await tap('ReceiveNumberPadTextField'); await sleep(700); @@ -45,6 +46,7 @@ describe('@numberpad - NumberPad', () => { ciIt('@numberpad_3 - Receive: Can enter amounts in classic denomination', async () => { await tap('Receive'); + await sleep(700); await tap('SpecifyInvoiceButton'); await tap('ReceiveNumberPadTextField'); await sleep(700); diff --git a/test/specs/settings.e2e.ts b/test/specs/settings.e2e.ts index 2035f83..ddc7478 100644 --- a/test/specs/settings.e2e.ts +++ b/test/specs/settings.e2e.ts @@ -154,6 +154,7 @@ describe('@settings - Settings', () => { // open receive tags, add a tag const tag = 'test123'; await tap('Receive'); + await sleep(700); await tap('SpecifyInvoiceButton'); (await elementByText(tag)).waitForDisplayed({ reverse: true }); @@ -177,6 +178,7 @@ describe('@settings - Settings', () => { // open receive tags, check tags are gone await tap('Receive'); + await sleep(700); await tap('SpecifyInvoiceButton'); (await elementByText(tag)).waitForDisplayed({ reverse: true }); await tap('TagsAdd'); From 4c4acf89bd4e2fe7fa99de5e243ce02c71750bc1 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 28 Nov 2025 16:44:00 +0100 Subject: [PATCH 15/50] waitForBackup in lightning --- test/specs/lightning.e2e.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/specs/lightning.e2e.ts b/test/specs/lightning.e2e.ts index d6161d3..1642a3a 100644 --- a/test/specs/lightning.e2e.ts +++ b/test/specs/lightning.e2e.ts @@ -24,6 +24,7 @@ import { dismissQuickPayIntro, doNavigationClose, acknowledgeReceivedPayment, + waitForBackup, } from '../helpers/actions'; import { reinstallApp } from '../helpers/setup'; import { bitcoinURL, lndConfig } from '../helpers/constants'; @@ -238,8 +239,7 @@ describe('@lightning - Lightning', () => { // wipe and restore wallet const seed = await getSeed(); - // await waitForBackup(); - await sleep(10_000); //temp wait (until we have a proper event for backup completion) + await waitForBackup(); await restoreWallet(seed); // check balance @@ -264,6 +264,7 @@ describe('@lightning - Lightning', () => { await tap('DrawerSettings'); await tap('AdvancedSettings'); await tap('Channels'); + await sleep(500); await tap('Channel'); await expectTextWithin('TotalSize', '₿ 100 000'); await swipeFullScreen('up'); From 38814ae63c70c3c16883dc5fd6fd2416b12e7e90 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Mon, 1 Dec 2025 15:31:02 +0100 Subject: [PATCH 16/50] RGS and Electrum toast ids --- test/helpers/actions.ts | 9 ++++++++- test/specs/settings.e2e.ts | 28 +++++++--------------------- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index e6109d8..1efdcbb 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -674,14 +674,21 @@ export async function receiveOnchainFunds( } type ToastId = + | 'RgsUpdatedToast' + | 'RgsErrorToast' + | 'ElectrumErrorToast' + | 'ElectrumUpdatedToast' | 'PaymentFailedToast' | 'ReceivedTransactionReplacedToast' | 'TransactionReplacedToast' | 'TransactionUnconfirmedToast' | 'TransactionRemovedToast'; -export async function waitForToast(toastId: ToastId) { +export async function waitForToast(toastId: ToastId, { waitToDisappear = true } = {}) { await elementById(toastId).waitForDisplayed(); + if (waitToDisappear) { + await elementById(toastId).waitForDisplayed({ reverse: true, timeout: 15_000 }); + } } /** Acknowledges the received payment notification by tapping the button. diff --git a/test/specs/settings.e2e.ts b/test/specs/settings.e2e.ts index ddc7478..93bbf6d 100644 --- a/test/specs/settings.e2e.ts +++ b/test/specs/settings.e2e.ts @@ -14,8 +14,8 @@ import { confirmInputOnKeyboard, multiTap, getAccessibleText, - expectText, doNavigationClose, + waitForToast, } from '../helpers/actions'; import { electrumHost, electrumPort } from '../helpers/constants'; import { launchFreshApp, reinstallApp } from '../helpers/setup'; @@ -380,7 +380,7 @@ describe('@settings - Settings', () => { // disconnected warning should appear await elementById('Disconnected').waitForDisplayed(); - await sleep(1000); + await waitForToast('ElectrumErrorToast'); // scanner - check all possible connection formats // Umbrel format @@ -397,20 +397,6 @@ describe('@settings - Settings', () => { expectedProtocol: 'TLS', }; - // should detect protocol for common ports - const noProto1 = { - url: `${electrumHost}:50001`, - expectedHost: electrumHost, - expectedPort: '50001', - expectedProtocol: 'TCP', - }; - const noProto2 = { - url: `${electrumHost}:50002`, - expectedHost: electrumHost, - expectedPort: '50002', - expectedProtocol: 'TLS', - }; - // HTTP URL const http1 = { url: `http://${electrumHost}:${electrumPort}`, @@ -425,7 +411,7 @@ describe('@settings - Settings', () => { expectedProtocol: 'TLS', }; - const conns = [umbrel1, umbrel2, noProto1, noProto2, http1, http2]; + const conns = [umbrel1, umbrel2, http1, http2]; let i = 0; for (const conn of conns) { await sleep(1000); @@ -437,6 +423,7 @@ describe('@settings - Settings', () => { await tap('ScanPrompt'); await typeText('QRInput', conn.url); await tap('DialogConfirm'); + await waitForToast('ElectrumUpdatedToast'); await expect(await elementById('HostInput')).toHaveText(conn.expectedHost); expect(await elementById('PortInput')).toHaveText(conn.expectedPort); // await expectTextWithin('ElectrumProtocol', conn.expectedProtocol); @@ -447,6 +434,7 @@ describe('@settings - Settings', () => { await elementById('ResetToDefault').waitForEnabled(); await tap('ResetToDefault'); await tap('ConnectToHost'); + await waitForToast('ElectrumUpdatedToast', { waitToDisappear: false }); await elementById('Connected').waitForDisplayed(); await sleep(1000); }); @@ -467,16 +455,14 @@ describe('@settings - Settings', () => { await typeText('RGSUrl', newUrl); await confirmInputOnKeyboard(); await tap('ConnectToHost'); - const updatedMsg = 'Rapid-Gossip-Sync Server Updated'; - await expectText(updatedMsg); - await expectText(updatedMsg, { visible: false }); + await waitForToast('RgsUpdatedToast'); const updatedUrl = await (await elementById('ConnectedUrl')).getText(); await expect(updatedUrl).toBe(newUrl); // switch back to default await tap('ResetToDefault'); await tap('ConnectToHost'); - await expectText(updatedMsg); + await waitForToast('RgsUpdatedToast', { waitToDisappear: false }); const resetUrl = await (await elementById('ConnectedUrl')).getText(); await expect(resetUrl).toBe(rgsUrl); From 2f92f3df62cce0ef9f7f83ca7b89f70a1961906f Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Mon, 1 Dec 2025 17:24:47 +0100 Subject: [PATCH 17/50] adjust settings_10 --- test/helpers/actions.ts | 4 ++-- test/specs/settings.e2e.ts | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 1efdcbb..680779a 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -673,7 +673,7 @@ export async function receiveOnchainFunds( } } -type ToastId = +export type ToastId = | 'RgsUpdatedToast' | 'RgsErrorToast' | 'ElectrumErrorToast' @@ -687,7 +687,7 @@ type ToastId = export async function waitForToast(toastId: ToastId, { waitToDisappear = true } = {}) { await elementById(toastId).waitForDisplayed(); if (waitToDisappear) { - await elementById(toastId).waitForDisplayed({ reverse: true, timeout: 15_000 }); + await elementById(toastId).waitForDisplayed({ reverse: true }); } } diff --git a/test/specs/settings.e2e.ts b/test/specs/settings.e2e.ts index 93bbf6d..66057fe 100644 --- a/test/specs/settings.e2e.ts +++ b/test/specs/settings.e2e.ts @@ -16,6 +16,7 @@ import { getAccessibleText, doNavigationClose, waitForToast, + ToastId, } from '../helpers/actions'; import { electrumHost, electrumPort } from '../helpers/constants'; import { launchFreshApp, reinstallApp } from '../helpers/setup'; @@ -389,12 +390,14 @@ describe('@settings - Settings', () => { expectedHost: electrumHost, expectedPort: electrumPort.toString(), expectedProtocol: 'TCP', + expectedToastMessage: 'ElectrumUpdatedToast', }; const umbrel2 = { url: `${electrumHost}:${electrumPort}:s`, expectedHost: electrumHost, expectedPort: electrumPort.toString(), expectedProtocol: 'TLS', + expectedToastMessage: driver.isAndroid ? 'ElectrumErrorToast' : 'ElectrumUpdatedToast', }; // HTTP URL @@ -403,17 +406,20 @@ describe('@settings - Settings', () => { expectedHost: electrumHost, expectedPort: electrumPort.toString(), expectedProtocol: 'TCP', + expectedToastMessage: 'ElectrumUpdatedToast', }; const http2 = { url: `https://${electrumHost}:${electrumPort}`, expectedHost: electrumHost, expectedPort: electrumPort.toString(), expectedProtocol: 'TLS', + expectedToastMessage: driver.isAndroid ? 'ElectrumErrorToast' : 'ElectrumUpdatedToast', }; const conns = [umbrel1, umbrel2, http1, http2]; let i = 0; for (const conn of conns) { + console.info(`Testing Electrum connection format #${i + 1}: ${conn.url}`); await sleep(1000); await tap('NavigationAction'); // on the first time we need to accept the notifications permission dialog to use camera @@ -423,7 +429,7 @@ describe('@settings - Settings', () => { await tap('ScanPrompt'); await typeText('QRInput', conn.url); await tap('DialogConfirm'); - await waitForToast('ElectrumUpdatedToast'); + await waitForToast(conn.expectedToastMessage as ToastId); await expect(await elementById('HostInput')).toHaveText(conn.expectedHost); expect(await elementById('PortInput')).toHaveText(conn.expectedPort); // await expectTextWithin('ElectrumProtocol', conn.expectedProtocol); @@ -434,7 +440,9 @@ describe('@settings - Settings', () => { await elementById('ResetToDefault').waitForEnabled(); await tap('ResetToDefault'); await tap('ConnectToHost'); - await waitForToast('ElectrumUpdatedToast', { waitToDisappear: false }); + if (driver.isIOS) { + await waitForToast('ElectrumUpdatedToast', { waitToDisappear: false }); + } await elementById('Connected').waitForDisplayed(); await sleep(1000); }); From 2f308ab1480458e44ec8bbc713416c8fd2054735 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 3 Dec 2025 10:39:37 +0100 Subject: [PATCH 18/50] add Balance toast ids and dismiss to waitForToast --- test/helpers/actions.ts | 14 ++++++++++---- test/specs/settings.e2e.ts | 3 +++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 680779a..0140c75 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -651,9 +651,6 @@ export async function receiveOnchainFunds( await acknowledgeReceivedPayment(); await mineBlocks(rpc, blocksToMine); - // if (blocksToMine > 0) { - // await waitForToast('PaymentConfirmedToast'); - // } if (driver.isAndroid) { await dismissBackupTimedSheet(); @@ -674,6 +671,8 @@ export async function receiveOnchainFunds( } export type ToastId = + | 'BalanceUnitSwitchedToast' + | 'BalanceHiddenToast' | 'RgsUpdatedToast' | 'RgsErrorToast' | 'ElectrumErrorToast' @@ -684,10 +683,17 @@ export type ToastId = | 'TransactionUnconfirmedToast' | 'TransactionRemovedToast'; -export async function waitForToast(toastId: ToastId, { waitToDisappear = true } = {}) { +export async function waitForToast( + toastId: ToastId, + { waitToDisappear = false, dismiss = true } = {} +) { await elementById(toastId).waitForDisplayed(); if (waitToDisappear) { await elementById(toastId).waitForDisplayed({ reverse: true }); + return; + } + if (dismiss) { + await dragOnElement(toastId, 'up', 0.2); } } diff --git a/test/specs/settings.e2e.ts b/test/specs/settings.e2e.ts index 66057fe..bfe7fa2 100644 --- a/test/specs/settings.e2e.ts +++ b/test/specs/settings.e2e.ts @@ -218,6 +218,9 @@ describe('@settings - Settings', () => { await dragOnElement('TotalBalance', 'right', 0.5); } await elementById('ShowBalance').waitForDisplayed(); + if (driver.isIOS) { + await waitForToast('BalanceHiddenToast', { waitToDisappear: false, dismiss: true }); + } // Disable 'swipe to hide balance' await tap('HeaderMenu'); From a0c52a93d6094fe56f8c1db3fcd7f6b920555b98 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 3 Dec 2025 11:31:33 +0100 Subject: [PATCH 19/50] remove tapBalanceToReset in launchFreshApp --- test/helpers/setup.ts | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/test/helpers/setup.ts b/test/helpers/setup.ts index bfcbfd8..a66dca9 100644 --- a/test/helpers/setup.ts +++ b/test/helpers/setup.ts @@ -1,32 +1,13 @@ import { execSync } from 'node:child_process'; -import { elementsById, sleep, tap } from './actions'; +import { sleep } from './actions'; import { getAppId, getAppPath } from './constants'; -export async function launchFreshApp({ tryHandleAlert = true } = {}) { +export async function launchFreshApp() { const appId = getAppId(); await driver.terminateApp(appId); await driver.activateApp(appId); - // workaround to get rid of "Bitkit is running in background" alert - if (tryHandleAlert) { - await sleep(1000); - try { - await tapBalanceToReset(); - } catch { - await tapBalanceToReset(); - } - } - await sleep(500); -} - -async function tapBalanceToReset() { - await tap('TotalBalance'); - const moneyFiatSymbols = await elementsById('MoneyFiatSymbol'); - moneyFiatSymbols[0].waitForDisplayed(); - moneyFiatSymbols[1].waitForDisplayed(); - if ((await moneyFiatSymbols[1].getText()) !== '₿') { - await tap('TotalBalance'); - } + await sleep(3000); } /** From e6475a520006dd221aebab2ad7cf894a5483ffa6 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 3 Dec 2025 11:32:03 +0100 Subject: [PATCH 20/50] add BalanceUnitSwitchedToast --- test/specs/settings.e2e.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/specs/settings.e2e.ts b/test/specs/settings.e2e.ts index bfe7fa2..7f9d9d9 100644 --- a/test/specs/settings.e2e.ts +++ b/test/specs/settings.e2e.ts @@ -43,6 +43,9 @@ describe('@settings - Settings', () => { await tap('TotalBalance'); } await expect(fiatSymbol).toHaveText('$'); + if (driver.isIOS) { + await waitForToast('BalanceUnitSwitchedToast'); + } // - change settings (currency to EUR) // await tap('HeaderMenu'); @@ -132,6 +135,7 @@ describe('@settings - Settings', () => { await tap('N1'); await tap('Continue'); await tap('NavigationBack'); + await sleep(1000); await expect(await elementByIdWithin('TransactionSpeedSettings', 'Value')).toHaveText( /.*Custom/ ); @@ -245,7 +249,7 @@ describe('@settings - Settings', () => { // Restart the app await sleep(3000); - await launchFreshApp({ tryHandleAlert: driver.isAndroid }); + await launchFreshApp(); // Balance should be hidden await elementById('ShowBalance').waitForDisplayed(); }); @@ -259,6 +263,7 @@ describe('@settings - Settings', () => { await sleep(1000); await tap('ResetAndRestore'); await tap('NavigationBack'); + await sleep(1000); await tap('BackupWallet'); await sleep(1000); // animation From d30efb343689718f184162b9a5c18f5fba04ac70 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 3 Dec 2025 11:39:47 +0100 Subject: [PATCH 21/50] disable check for iOS (bitkit-ios/issues/260) --- test/specs/settings.e2e.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/specs/settings.e2e.ts b/test/specs/settings.e2e.ts index 7f9d9d9..7bf14f2 100644 --- a/test/specs/settings.e2e.ts +++ b/test/specs/settings.e2e.ts @@ -251,7 +251,10 @@ describe('@settings - Settings', () => { await sleep(3000); await launchFreshApp(); // Balance should be hidden - await elementById('ShowBalance').waitForDisplayed(); + // https://github.com/synonymdev/bitkit-ios/issues/260 + if (driver.isAndroid) { + await elementById('ShowBalance').waitForDisplayed(); + } }); }); From 2b69f8b8586e7faf54bd08a777b02c24c5e2b4ed Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 3 Dec 2025 12:59:07 +0100 Subject: [PATCH 22/50] stability --- test/specs/settings.e2e.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/specs/settings.e2e.ts b/test/specs/settings.e2e.ts index 7bf14f2..c7fd800 100644 --- a/test/specs/settings.e2e.ts +++ b/test/specs/settings.e2e.ts @@ -125,6 +125,7 @@ describe('@settings - Settings', () => { // switch to Fast await tap('TransactionSpeedSettings'); await tap('fast'); + await sleep(1000); await expect(await elementByIdWithin('TransactionSpeedSettings', 'Value')).toHaveText( /.*Fast/ ); @@ -143,6 +144,7 @@ describe('@settings - Settings', () => { // switch back to Normal await tap('TransactionSpeedSettings'); await tap('normal'); + await sleep(1000); await expect(await elementByIdWithin('TransactionSpeedSettings', 'Value')).toHaveText( /.*Normal/ ); @@ -265,6 +267,7 @@ describe('@settings - Settings', () => { await tap('BackupSettings'); await sleep(1000); await tap('ResetAndRestore'); + await sleep(1000); await tap('NavigationBack'); await sleep(1000); await tap('BackupWallet'); From 187b90eb11366864d6e3525867cc54a40a6ddb99 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 3 Dec 2025 13:40:42 +0100 Subject: [PATCH 23/50] adjust settings_10 after ios fix --- test/specs/settings.e2e.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/specs/settings.e2e.ts b/test/specs/settings.e2e.ts index 66057fe..c0eca2d 100644 --- a/test/specs/settings.e2e.ts +++ b/test/specs/settings.e2e.ts @@ -380,7 +380,6 @@ describe('@settings - Settings', () => { await tap('ConnectToHost'); // disconnected warning should appear - await elementById('Disconnected').waitForDisplayed(); await waitForToast('ElectrumErrorToast'); // scanner - check all possible connection formats @@ -397,7 +396,7 @@ describe('@settings - Settings', () => { expectedHost: electrumHost, expectedPort: electrumPort.toString(), expectedProtocol: 'TLS', - expectedToastMessage: driver.isAndroid ? 'ElectrumErrorToast' : 'ElectrumUpdatedToast', + expectedToastMessage: 'ElectrumErrorToast', }; // HTTP URL @@ -413,7 +412,7 @@ describe('@settings - Settings', () => { expectedHost: electrumHost, expectedPort: electrumPort.toString(), expectedProtocol: 'TLS', - expectedToastMessage: driver.isAndroid ? 'ElectrumErrorToast' : 'ElectrumUpdatedToast', + expectedToastMessage: 'ElectrumErrorToast', }; const conns = [umbrel1, umbrel2, http1, http2]; From 71782aed74b4c3cd371d8f6125325e21e7c733b0 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 3 Dec 2025 15:27:20 +0100 Subject: [PATCH 24/50] adjust lightning --- test/specs/lightning.e2e.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/specs/lightning.e2e.ts b/test/specs/lightning.e2e.ts index 1642a3a..4562398 100644 --- a/test/specs/lightning.e2e.ts +++ b/test/specs/lightning.e2e.ts @@ -264,8 +264,9 @@ describe('@lightning - Lightning', () => { await tap('DrawerSettings'); await tap('AdvancedSettings'); await tap('Channels'); - await sleep(500); + await sleep(2000); await tap('Channel'); + await sleep(1000); await expectTextWithin('TotalSize', '₿ 100 000'); await swipeFullScreen('up'); await elementById('IsUsableYes').waitForDisplayed(); @@ -273,7 +274,6 @@ describe('@lightning - Lightning', () => { // close channel await tap('CloseConnection'); await tap('CloseConnectionButton'); - await acknowledgeReceivedPayment(); await elementByText('Transfer Initiated').waitForDisplayed(); await elementByText('Transfer Initiated').waitForDisplayed({ reverse: true }); From a7e940cbd10d2f34af7b49aaf70949abe9562188 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Tue, 2 Dec 2025 15:21:25 +0100 Subject: [PATCH 25/50] Adjust lightning --- test/helpers/actions.ts | 32 ++++++++++++++++++++++++++------ test/specs/lightning.e2e.ts | 13 +++++++++++-- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 0140c75..fc20833 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -721,6 +721,18 @@ export async function doTriggerTimedSheet() { await doNavigationClose(); } +export async function dismissBackgroundPaymentsTimedSheet({ + triggerTimedSheet = false, +}: { triggerTimedSheet?: boolean } = {}) { + if (triggerTimedSheet) { + await doTriggerTimedSheet(); + } + await elementById('BackgroundPaymentsDescription').waitForDisplayed(); + await sleep(500); // wait for the app to settle + await tap('BackgroundPaymentsCancel'); + await sleep(500); +} + /** * Dismisses the backup reminder sheet. * This sheet is triggered by first onchain balance change. @@ -744,7 +756,7 @@ export async function dismissBackupTimedSheet({ } await elementById('BackupIntroViewDescription').waitForDisplayed(); await sleep(500); // wait for the app to settle - await tap('BackupIntroViewCancel'); + await swipeFullScreen('down'); await sleep(500); } @@ -766,14 +778,22 @@ export async function dismissBackupTimedSheet({ export async function dismissQuickPayIntro({ triggerTimedSheet = false, }: { triggerTimedSheet?: boolean } = {}) { - if (driver.isIOS) return; // Not supported on iOS yet if (triggerTimedSheet) { await doTriggerTimedSheet(); } - await elementById('QuickpayIntro-button').waitForDisplayed(); - await sleep(500); // wait for the app to settle - await swipeFullScreen('down'); - await sleep(500); + + if (driver.isAndroid) { + // TODO: it's temp, change on Android to match iOS testID + await elementById('QuickpayIntro-button').waitForDisplayed(); + await sleep(500); // wait for the app to settle + await swipeFullScreen('down'); + await sleep(500); + } else { + await elementById('QuickpayIntroDescription').waitForDisplayed(); + await sleep(500); // wait for the app to settle + await tap('QuickpayIntroCancel'); + await sleep(500); + } } /** diff --git a/test/specs/lightning.e2e.ts b/test/specs/lightning.e2e.ts index 4562398..d4bc337 100644 --- a/test/specs/lightning.e2e.ts +++ b/test/specs/lightning.e2e.ts @@ -25,6 +25,7 @@ import { doNavigationClose, acknowledgeReceivedPayment, waitForBackup, + dismissBackgroundPaymentsTimedSheet, } from '../helpers/actions'; import { reinstallApp } from '../helpers/setup'; import { bitcoinURL, lndConfig } from '../helpers/constants'; @@ -112,7 +113,12 @@ describe('@lightning - Lightning', () => { await elementById('ReceivedTransaction').waitForDisplayed(); await tap('ReceivedTransactionButton'); await sleep(500); - await dismissQuickPayIntro(); + if (driver.isIOS) { + await dismissBackgroundPaymentsTimedSheet({ triggerTimedSheet: driver.isIOS }); + await dismissQuickPayIntro({ triggerTimedSheet: driver.isIOS }); + } else { + await dismissQuickPayIntro(); + } const totalBalance = await elementByIdWithin('TotalBalance-primary', 'MoneyText'); await expect(totalBalance).toHaveText('11 000'); // 1k onchain + 10k lightning await expectTextWithin('ActivitySpending', '10 000'); @@ -196,6 +202,7 @@ describe('@lightning - Lightning', () => { await swipeFullScreen('up'); await swipeFullScreen('up'); await tap('ActivityShowAll'); + // All transactions await expectTextWithin('Activity-1', '-'); await expectTextWithin('Activity-2', '-'); @@ -280,7 +287,9 @@ describe('@lightning - Lightning', () => { await mineBlocks(rpc, 6); await electrum?.waitForSync(); await elementById('Channel').waitForDisplayed({ reverse: true }); - await tap('NavigationBack'); + if (driver.isAndroid) { + await tap('NavigationBack'); + } await doNavigationClose(); await swipeFullScreen('up'); From 9168cbbcddd02a817012166801a07814329514c4 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 3 Dec 2025 17:07:02 +0100 Subject: [PATCH 26/50] stability --- test/helpers/actions.ts | 1 + test/specs/lightning.e2e.ts | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index fc20833..344fa77 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -715,6 +715,7 @@ export async function acknowledgeReceivedPayment() { * await doTriggerTimedSheet(); */ export async function doTriggerTimedSheet() { + await sleep(700); // wait for any previous animations to finish await tap('HeaderMenu'); await tap('DrawerSettings'); await sleep(500); // wait for the app to settle diff --git a/test/specs/lightning.e2e.ts b/test/specs/lightning.e2e.ts index d4bc337..924c354 100644 --- a/test/specs/lightning.e2e.ts +++ b/test/specs/lightning.e2e.ts @@ -23,7 +23,6 @@ import { elementByText, dismissQuickPayIntro, doNavigationClose, - acknowledgeReceivedPayment, waitForBackup, dismissBackgroundPaymentsTimedSheet, } from '../helpers/actions'; @@ -112,7 +111,7 @@ describe('@lightning - Lightning', () => { console.info({ response }); await elementById('ReceivedTransaction').waitForDisplayed(); await tap('ReceivedTransactionButton'); - await sleep(500); + await sleep(1000); if (driver.isIOS) { await dismissBackgroundPaymentsTimedSheet({ triggerTimedSheet: driver.isIOS }); await dismissQuickPayIntro({ triggerTimedSheet: driver.isIOS }); From 562b9d4db28eb9b165e957a2e79eb5c4fc876161 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 26 Nov 2025 19:30:08 +0100 Subject: [PATCH 27/50] acceptReceivedPayment for onchain payments --- test/helpers/actions.ts | 14 ++++++++++---- test/specs/lightning.e2e.ts | 5 ++--- test/specs/onchain.e2e.ts | 9 +++++---- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index c754058..487f9d0 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -626,6 +626,12 @@ export async function mineBlocks(rpc: BitcoinJsonRpc, blocks: number = 1) { } } +export async function acceptReceivedPayment() { + await elementById('ReceivedTransaction').waitForDisplayed(); + await tap('ReceivedTransactionButton'); + await sleep(300); +} + export async function receiveOnchainFunds( rpc: BitcoinJsonRpc, { @@ -647,11 +653,11 @@ export async function receiveOnchainFunds( const address = await getReceiveAddress(); await swipeFullScreen('down'); await rpc.sendToAddress(address, btc); - await mineBlocks(rpc, blocksToMine); - // https://github.com/synonymdev/bitkit-android/issues/268 - // send - onchain - receiver sees no confetti — missing-in-ldk-node missing onchain payment event - // await elementById('ReceivedTransaction').waitForDisplayed(); + await acceptReceivedPayment(); + + await mineBlocks(rpc, blocksToMine); + await expectText('Payment Confirmed'); if (driver.isAndroid) { await dismissBackupTimedSheet(); diff --git a/test/specs/lightning.e2e.ts b/test/specs/lightning.e2e.ts index 028f68b..32e9c82 100644 --- a/test/specs/lightning.e2e.ts +++ b/test/specs/lightning.e2e.ts @@ -23,6 +23,7 @@ import { elementByText, dismissQuickPayIntro, doNavigationClose, + acceptReceivedPayment, } from '../helpers/actions'; import { reinstallApp } from '../helpers/setup'; import { bitcoinURL, lndConfig } from '../helpers/constants'; @@ -273,9 +274,7 @@ describe('@lightning - Lightning', () => { await mineBlocks(rpc, 6); await electrum?.waitForSync(); - // https://github.com/synonymdev/bitkit-android/issues/268 - // send - onchain - receiver sees no confetti — missing-in-ldk-node missing onchain payment event - // await elementById('ReceivedTransaction').waitForDisplayed(); + await acceptReceivedPayment(); await elementById('Channel').waitForDisplayed({ reverse: true }); await tap('NavigationBack'); await doNavigationClose(); diff --git a/test/specs/onchain.e2e.ts b/test/specs/onchain.e2e.ts index 667b857..d3d7256 100644 --- a/test/specs/onchain.e2e.ts +++ b/test/specs/onchain.e2e.ts @@ -24,6 +24,8 @@ import { dismissBackupTimedSheet, handleOver50PercentAlert, handleOver100Alert, + acceptReceivedPayment, + expectText, } from '../helpers/actions'; import { ciIt } from '../helpers/suite'; @@ -124,12 +126,11 @@ describe('@onchain - Onchain', () => { await swipeFullScreen('down'); await rpc.sendToAddress(address, '1'); + await acceptReceivedPayment(); + await mineBlocks(rpc, 1); await electrum?.waitForSync(); - - // https://github.com/synonymdev/bitkit-android/issues/268 - // send - onchain - receiver sees no confetti — missing-in-ldk-node missing onchain payment event - // await elementById('ReceivedTransaction').waitForDisplayed(); + await expectText('Payment Confirmed'); if (i === 1 && driver.isAndroid) { await dismissBackupTimedSheet(); From 3f8deabbc34a8c6c1ddf224f88a79e033fdf2f49 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 26 Nov 2025 22:11:38 +0100 Subject: [PATCH 28/50] adjust PaymentConfirmedToast --- test/helpers/actions.ts | 4 +++- test/specs/onchain.e2e.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 487f9d0..8fd4257 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -657,7 +657,9 @@ export async function receiveOnchainFunds( await acceptReceivedPayment(); await mineBlocks(rpc, blocksToMine); - await expectText('Payment Confirmed'); + if (blocksToMine > 0) { + await elementById('PaymentConfirmedToast').waitForDisplayed(); + } if (driver.isAndroid) { await dismissBackupTimedSheet(); diff --git a/test/specs/onchain.e2e.ts b/test/specs/onchain.e2e.ts index d3d7256..5741436 100644 --- a/test/specs/onchain.e2e.ts +++ b/test/specs/onchain.e2e.ts @@ -130,7 +130,7 @@ describe('@onchain - Onchain', () => { await mineBlocks(rpc, 1); await electrum?.waitForSync(); - await expectText('Payment Confirmed'); + await elementById('PaymentConfirmedToast').waitForDisplayed(); if (i === 1 && driver.isAndroid) { await dismissBackupTimedSheet(); From 388a447a634b0f5a2999b11792a2820cc31a086b Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 26 Nov 2025 22:14:25 +0100 Subject: [PATCH 29/50] acknowledgeReceivedPayment --- test/helpers/actions.ts | 16 +++++++++------- test/specs/lightning.e2e.ts | 4 ++-- test/specs/onchain.e2e.ts | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 8fd4257..be91f2f 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -626,12 +626,6 @@ export async function mineBlocks(rpc: BitcoinJsonRpc, blocks: number = 1) { } } -export async function acceptReceivedPayment() { - await elementById('ReceivedTransaction').waitForDisplayed(); - await tap('ReceivedTransactionButton'); - await sleep(300); -} - export async function receiveOnchainFunds( rpc: BitcoinJsonRpc, { @@ -654,7 +648,7 @@ export async function receiveOnchainFunds( await swipeFullScreen('down'); await rpc.sendToAddress(address, btc); - await acceptReceivedPayment(); + await acknowledgeReceivedPayment(); await mineBlocks(rpc, blocksToMine); if (blocksToMine > 0) { @@ -679,6 +673,14 @@ export async function receiveOnchainFunds( } } +/** Acknowledges the received payment notification by tapping the button. + */ +export async function acknowledgeReceivedPayment() { + await elementById('ReceivedTransaction').waitForDisplayed(); + await tap('ReceivedTransactionButton'); + await sleep(300); +} + /** * Triggers the timed backup sheet by navigating to settings and back. * Since timed sheets are sometimes triggered by user behavior (when user goes back to home screen), diff --git a/test/specs/lightning.e2e.ts b/test/specs/lightning.e2e.ts index 32e9c82..c4b2041 100644 --- a/test/specs/lightning.e2e.ts +++ b/test/specs/lightning.e2e.ts @@ -23,7 +23,7 @@ import { elementByText, dismissQuickPayIntro, doNavigationClose, - acceptReceivedPayment, + acknowledgeReceivedPayment, } from '../helpers/actions'; import { reinstallApp } from '../helpers/setup'; import { bitcoinURL, lndConfig } from '../helpers/constants'; @@ -274,7 +274,7 @@ describe('@lightning - Lightning', () => { await mineBlocks(rpc, 6); await electrum?.waitForSync(); - await acceptReceivedPayment(); + await acknowledgeReceivedPayment(); await elementById('Channel').waitForDisplayed({ reverse: true }); await tap('NavigationBack'); await doNavigationClose(); diff --git a/test/specs/onchain.e2e.ts b/test/specs/onchain.e2e.ts index 5741436..16ebd20 100644 --- a/test/specs/onchain.e2e.ts +++ b/test/specs/onchain.e2e.ts @@ -24,7 +24,7 @@ import { dismissBackupTimedSheet, handleOver50PercentAlert, handleOver100Alert, - acceptReceivedPayment, + acknowledgeReceivedPayment, expectText, } from '../helpers/actions'; import { ciIt } from '../helpers/suite'; @@ -126,7 +126,7 @@ describe('@onchain - Onchain', () => { await swipeFullScreen('down'); await rpc.sendToAddress(address, '1'); - await acceptReceivedPayment(); + await acknowledgeReceivedPayment(); await mineBlocks(rpc, 1); await electrum?.waitForSync(); From cae95a965d2623df949643cd85ce7309665f2c51 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 27 Nov 2025 10:46:37 +0100 Subject: [PATCH 30/50] waitForToast --- test/helpers/actions.ts | 15 ++++++++++++++- test/specs/boost.e2e.ts | 19 +++++++++++-------- test/specs/onchain.e2e.ts | 4 ++-- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index be91f2f..9c21b03 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -652,7 +652,7 @@ export async function receiveOnchainFunds( await mineBlocks(rpc, blocksToMine); if (blocksToMine > 0) { - await elementById('PaymentConfirmedToast').waitForDisplayed(); + await waitForToast('PaymentConfirmedToast'); } if (driver.isAndroid) { @@ -673,6 +673,19 @@ export async function receiveOnchainFunds( } } +type ToastId = + | 'PaymentConfirmedToast' + | 'PaymentFailedToast' + | 'TransactionConfirmedToast' + | 'ReceivedTransactionReplacedToast' + | 'TransactionReplacedToast' + | 'TransactionUnconfirmedToast' + | 'TransactionRemovedToast'; + +export async function waitForToast(toastId: ToastId) { + await elementById(toastId).waitForDisplayed(); +} + /** Acknowledges the received payment notification by tapping the button. */ export async function acknowledgeReceivedPayment() { diff --git a/test/specs/boost.e2e.ts b/test/specs/boost.e2e.ts index 2708399..617c51c 100644 --- a/test/specs/boost.e2e.ts +++ b/test/specs/boost.e2e.ts @@ -20,6 +20,7 @@ import { getSeed, waitForBackup, restoreWallet, + waitForToast, } from '../helpers/actions'; import { bitcoinURL } from '../helpers/constants'; import initElectrum from '../helpers/electrum'; @@ -268,20 +269,22 @@ describe('@boost - Boost', () => { await elementById('StatusBoosting').waitForDisplayed(); await doNavigationClose(); await tap('ActivityShort-1'); - await elementById('BoostedButton').waitForDisplayed(); await elementById('StatusRemoved').waitForDisplayed(); // mine new block await mineBlocks(rpc, 1); - - // check activity item after mine - // TEMP: refresh until proper events available + await waitForToast('TransactionConfirmedToast'); await doNavigationClose(); await sleep(500); - await swipeFullScreen('down'); - await attemptRefreshOnHomeScreen(); - await swipeFullScreen('up'); - // TEMP: refresh until proper events available + + if (driver.isAndroid) { + // TEMP: refresh until proper events available + await swipeFullScreen('down'); + await attemptRefreshOnHomeScreen(); + await swipeFullScreen('up'); + // TEMP: refresh until proper events available + } + // check activity item after mine await elementById('ActivityShort-0').waitForDisplayed(); await tap('ActivityShort-0'); await elementById('StatusConfirmed').waitForDisplayed(); diff --git a/test/specs/onchain.e2e.ts b/test/specs/onchain.e2e.ts index 16ebd20..2fb78db 100644 --- a/test/specs/onchain.e2e.ts +++ b/test/specs/onchain.e2e.ts @@ -25,7 +25,7 @@ import { handleOver50PercentAlert, handleOver100Alert, acknowledgeReceivedPayment, - expectText, + waitForToast, } from '../helpers/actions'; import { ciIt } from '../helpers/suite'; @@ -130,7 +130,7 @@ describe('@onchain - Onchain', () => { await mineBlocks(rpc, 1); await electrum?.waitForSync(); - await elementById('PaymentConfirmedToast').waitForDisplayed(); + await waitForToast('PaymentConfirmedToast'); if (i === 1 && driver.isAndroid) { await dismissBackupTimedSheet(); From 71ea9f76f8f5ece646175e6e3210eac5d3b03c8e Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 27 Nov 2025 11:09:26 +0100 Subject: [PATCH 31/50] temp adjust boost_1 --- test/specs/boost.e2e.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/specs/boost.e2e.ts b/test/specs/boost.e2e.ts index 617c51c..6331b9c 100644 --- a/test/specs/boost.e2e.ts +++ b/test/specs/boost.e2e.ts @@ -84,7 +84,7 @@ describe('@boost - Boost', () => { // no additional boost tx item on iOS, there is one on Android // https://github.com/synonymdev/bitkit-android/issues/463 - const showsBoostTxItem = driver.isAndroid; + const showsBoostTxItem = driver.isAndroid || driver.isIOS; if (showsBoostTxItem) { await expect(elementById('ActivityShort-1')).toBeDisplayed(); await expect(elementById('ActivityShort-2')).not.toBeDisplayed(); @@ -144,19 +144,21 @@ describe('@boost - Boost', () => { // mine new block await mineBlocks(rpc, 1); - - // check activity item after mine - // TEMP: refresh until proper events available + await waitForToast('TransactionConfirmedToast'); await doNavigationClose(); await sleep(500); + + // TEMP: refresh until proper events available await swipeFullScreen('down'); await attemptRefreshOnHomeScreen(); await swipeFullScreen('up'); + // TEMP: refresh until proper events available + + // check activity item after mine await elementById('ActivityShort-0').waitForDisplayed(); if (showsBoostTxItem) { await elementById('ActivityShort-1').waitForDisplayed(); } - // TEMP: refresh until proper events available await tap('ActivityShort-0'); await elementById('StatusConfirmed').waitForDisplayed(); From a14f6e7fa08c8b3a0147f0e143811bc2c8af08a6 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 27 Nov 2025 11:10:15 +0100 Subject: [PATCH 32/50] remove refresh in boost --- test/specs/boost.e2e.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/test/specs/boost.e2e.ts b/test/specs/boost.e2e.ts index 6331b9c..08b48df 100644 --- a/test/specs/boost.e2e.ts +++ b/test/specs/boost.e2e.ts @@ -148,12 +148,6 @@ describe('@boost - Boost', () => { await doNavigationClose(); await sleep(500); - // TEMP: refresh until proper events available - await swipeFullScreen('down'); - await attemptRefreshOnHomeScreen(); - await swipeFullScreen('up'); - // TEMP: refresh until proper events available - // check activity item after mine await elementById('ActivityShort-0').waitForDisplayed(); if (showsBoostTxItem) { @@ -279,13 +273,6 @@ describe('@boost - Boost', () => { await doNavigationClose(); await sleep(500); - if (driver.isAndroid) { - // TEMP: refresh until proper events available - await swipeFullScreen('down'); - await attemptRefreshOnHomeScreen(); - await swipeFullScreen('up'); - // TEMP: refresh until proper events available - } // check activity item after mine await elementById('ActivityShort-0').waitForDisplayed(); await tap('ActivityShort-0'); From 23b66f80293604d0e8b2e45c60e7f3dc6546104c Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 27 Nov 2025 14:03:54 +0100 Subject: [PATCH 33/50] remove PaymentConfirmedToast and TransactionConfirmedToast --- test/helpers/actions.ts | 11 +++++------ test/specs/boost.e2e.ts | 4 ---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 9c21b03..b8c2683 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -651,9 +651,9 @@ export async function receiveOnchainFunds( await acknowledgeReceivedPayment(); await mineBlocks(rpc, blocksToMine); - if (blocksToMine > 0) { - await waitForToast('PaymentConfirmedToast'); - } + // if (blocksToMine > 0) { + // await waitForToast('PaymentConfirmedToast'); + // } if (driver.isAndroid) { await dismissBackupTimedSheet(); @@ -674,14 +674,13 @@ export async function receiveOnchainFunds( } type ToastId = - | 'PaymentConfirmedToast' + | 'PaymentConfirmedToast' // removed + | 'TransactionConfirmedToast' //removed | 'PaymentFailedToast' - | 'TransactionConfirmedToast' | 'ReceivedTransactionReplacedToast' | 'TransactionReplacedToast' | 'TransactionUnconfirmedToast' | 'TransactionRemovedToast'; - export async function waitForToast(toastId: ToastId) { await elementById(toastId).waitForDisplayed(); } diff --git a/test/specs/boost.e2e.ts b/test/specs/boost.e2e.ts index 08b48df..b9332cc 100644 --- a/test/specs/boost.e2e.ts +++ b/test/specs/boost.e2e.ts @@ -15,12 +15,10 @@ import { elementByIdWithin, getTextUnder, mineBlocks, - attemptRefreshOnHomeScreen, doNavigationClose, getSeed, waitForBackup, restoreWallet, - waitForToast, } from '../helpers/actions'; import { bitcoinURL } from '../helpers/constants'; import initElectrum from '../helpers/electrum'; @@ -144,7 +142,6 @@ describe('@boost - Boost', () => { // mine new block await mineBlocks(rpc, 1); - await waitForToast('TransactionConfirmedToast'); await doNavigationClose(); await sleep(500); @@ -269,7 +266,6 @@ describe('@boost - Boost', () => { // mine new block await mineBlocks(rpc, 1); - await waitForToast('TransactionConfirmedToast'); await doNavigationClose(); await sleep(500); From a32e01729af7ae22bd60bdadfa86ccdcd2f30ba2 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 27 Nov 2025 16:44:04 +0100 Subject: [PATCH 34/50] update toast ids --- test/helpers/actions.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index b8c2683..e6109d8 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -674,13 +674,12 @@ export async function receiveOnchainFunds( } type ToastId = - | 'PaymentConfirmedToast' // removed - | 'TransactionConfirmedToast' //removed | 'PaymentFailedToast' | 'ReceivedTransactionReplacedToast' | 'TransactionReplacedToast' | 'TransactionUnconfirmedToast' | 'TransactionRemovedToast'; + export async function waitForToast(toastId: ToastId) { await elementById(toastId).waitForDisplayed(); } From 8cb0bb56282b10085d8834618459022cf943ee3a Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 27 Nov 2025 16:44:19 +0100 Subject: [PATCH 35/50] update RBF --- test/specs/boost.e2e.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/test/specs/boost.e2e.ts b/test/specs/boost.e2e.ts index b9332cc..bd9083a 100644 --- a/test/specs/boost.e2e.ts +++ b/test/specs/boost.e2e.ts @@ -227,11 +227,10 @@ describe('@boost - Boost', () => { await elementById('BoostingIcon').waitForDisplayed(); await elementById('ActivityShort-0').waitForDisplayed(); await elementById('ActivityShort-1').waitForDisplayed(); - await elementById('ActivityShort-2').waitForDisplayed(); + await expect(elementById('ActivityShort-2')).not.toBeDisplayed(); await expectTextWithin('ActivityShort-0', '-'); - await expectTextWithin('ActivityShort-1', '-'); - await expectTextWithin('ActivityShort-2', '100 000'); - await expectTextWithin('ActivityShort-2', '+'); + await expectTextWithin('ActivityShort-1', '100 000'); + await expectTextWithin('ActivityShort-1', '+'); // new tx await tap('ActivityShort-0'); @@ -256,13 +255,10 @@ describe('@boost - Boost', () => { // check activity after restore await swipeFullScreen('up'); (await elementByIdWithin('ActivityShort-0', 'BoostingIcon')).waitForDisplayed(); - (await elementByIdWithin('ActivityShort-1', 'BoostingIcon')).waitForDisplayed(); await tap('ActivityShort-0'); await elementById('BoostedButton').waitForDisplayed(); await elementById('StatusBoosting').waitForDisplayed(); await doNavigationClose(); - await tap('ActivityShort-1'); - await elementById('StatusRemoved').waitForDisplayed(); // mine new block await mineBlocks(rpc, 1); @@ -274,8 +270,5 @@ describe('@boost - Boost', () => { await tap('ActivityShort-0'); await elementById('StatusConfirmed').waitForDisplayed(); await doNavigationClose(); - (await elementByIdWithin('ActivityShort-1', 'BoostingIcon')).waitForDisplayed(); - await tap('ActivityShort-1'); - await elementById('StatusRemoved').waitForDisplayed(); }); }); From 61ff965a0fcf8d9c64691eb5feb1dd9d3a387564 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 27 Nov 2025 17:05:46 +0100 Subject: [PATCH 36/50] onchain PaymentConfirmedToast --- test/specs/onchain.e2e.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/specs/onchain.e2e.ts b/test/specs/onchain.e2e.ts index 2fb78db..8c96a64 100644 --- a/test/specs/onchain.e2e.ts +++ b/test/specs/onchain.e2e.ts @@ -25,7 +25,6 @@ import { handleOver50PercentAlert, handleOver100Alert, acknowledgeReceivedPayment, - waitForToast, } from '../helpers/actions'; import { ciIt } from '../helpers/suite'; @@ -130,7 +129,6 @@ describe('@onchain - Onchain', () => { await mineBlocks(rpc, 1); await electrum?.waitForSync(); - await waitForToast('PaymentConfirmedToast'); if (i === 1 && driver.isAndroid) { await dismissBackupTimedSheet(); From 715373c9547cae99b8bd0ef88ac78c7ed3eb42b2 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 27 Nov 2025 20:50:46 +0100 Subject: [PATCH 37/50] adjust CPFP --- test/specs/boost.e2e.ts | 61 ++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 41 deletions(-) diff --git a/test/specs/boost.e2e.ts b/test/specs/boost.e2e.ts index bd9083a..c5bb101 100644 --- a/test/specs/boost.e2e.ts +++ b/test/specs/boost.e2e.ts @@ -79,25 +79,16 @@ describe('@boost - Boost', () => { // check Activity await elementById('BoostingIcon').waitForDisplayed(); await elementById('ActivityShort-0').waitForDisplayed(); - - // no additional boost tx item on iOS, there is one on Android - // https://github.com/synonymdev/bitkit-android/issues/463 - const showsBoostTxItem = driver.isAndroid || driver.isIOS; - if (showsBoostTxItem) { - await expect(elementById('ActivityShort-1')).toBeDisplayed(); - await expect(elementById('ActivityShort-2')).not.toBeDisplayed(); - } else { - await expect(elementById('ActivityShort-1')).not.toBeDisplayed(); - await expect(elementById('ActivityShort-2')).not.toBeDisplayed(); - } + await elementById('ActivityShort-1').waitForDisplayed(); + await expect(elementById('ActivityShort-2')).not.toBeDisplayed(); + await expectTextWithin('ActivityShort-0', '-'); + await expectTextWithin('ActivityShort-0', 'Boost Fee'); + await expectTextWithin('ActivityShort-1', '100 000'); + await expectTextWithin('ActivityShort-1', '+'); // orig tx still there await swipeFullScreen('up'); - if (showsBoostTxItem) { - await tap('ActivityShort-1'); - } else { - await tap('ActivityShort-0'); - } + await tap('ActivityShort-1'); await expectText('100 000', { strategy: 'contains' }); await elementById('BoostedButton').waitForDisplayed(); await elementById('StatusBoosting').waitForDisplayed(); @@ -110,17 +101,14 @@ describe('@boost - Boost', () => { console.info({ parentTxId }); await doNavigationClose(); - if (showsBoostTxItem) { - // new tx - await tap('ActivityShort-0'); - await tap('ActivityTxDetails'); - const boostTxId = await getTextUnder('TXID'); - console.info({ newTxId: boostTxId }); - await expect(origTxId !== boostTxId).toBe(true); - // TODO: not implemented yet - // await expect(boostTxId === parentTxId).toBe(true); - await doNavigationClose(); - } + // new tx: Boost Fee + await tap('ActivityShort-0'); + await tap('ActivityTxDetails'); + const boostTxId = await getTextUnder('TXID'); + console.info({ newTxId: boostTxId }); + await expect(origTxId !== boostTxId).toBe(true); + await expect(boostTxId === parentTxId).toBe(true); + await doNavigationClose(); // wipe & restore const seed = await getSeed(); @@ -130,13 +118,8 @@ describe('@boost - Boost', () => { // check activity after restore await swipeFullScreen('up'); await elementById('BoostingIcon').waitForDisplayed(); - if (showsBoostTxItem) { - await elementById('ActivityShort-1').waitForDisplayed(); - await tap('ActivityShort-1'); - } else { - await elementById('ActivityShort-0').waitForDisplayed(); - await tap('ActivityShort-0'); - } + await elementById('ActivityShort-1').waitForDisplayed(); + await tap('ActivityShort-1'); await elementById('BoostedButton').waitForDisplayed(); await elementById('StatusBoosting').waitForDisplayed(); @@ -147,17 +130,13 @@ describe('@boost - Boost', () => { // check activity item after mine await elementById('ActivityShort-0').waitForDisplayed(); - if (showsBoostTxItem) { - await elementById('ActivityShort-1').waitForDisplayed(); - } + await elementById('ActivityShort-1').waitForDisplayed(); await tap('ActivityShort-0'); await elementById('StatusConfirmed').waitForDisplayed(); await doNavigationClose(); - if (showsBoostTxItem) { - await tap('ActivityShort-1'); - await elementById('StatusConfirmed').waitForDisplayed(); - } + await tap('ActivityShort-1'); + await elementById('StatusConfirmed').waitForDisplayed(); }); ciIt('@boost_2 - Can do RBF', async () => { From fd994aedab94042843e31bb5fb4e519c10f52b1a Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 28 Nov 2025 09:54:38 +0100 Subject: [PATCH 38/50] transfer_1 stability --- test/specs/transfer.e2e.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/specs/transfer.e2e.ts b/test/specs/transfer.e2e.ts index 67feb82..d6cac74 100644 --- a/test/specs/transfer.e2e.ts +++ b/test/specs/transfer.e2e.ts @@ -87,7 +87,7 @@ describe('@transfer - Transfer', () => { await tap('TransferIntro-button'); await tap('FundTransfer'); await tap('SpendingIntro-button'); - await sleep(1000); // let the animation finish + await sleep(3000); // let the animation finish //--- skip due to: https://github.com/synonymdev/bitkit-android/issues/425 ---// //// can continue with default client balance (0) @@ -118,6 +118,7 @@ describe('@transfer - Transfer', () => { //--- skip due to: https://github.com/synonymdev/bitkit-android/issues/424 ---// // can continue with 25% client balance + await elementById('SpendingAmountQuarter').waitForEnabled(); await tap('SpendingAmountQuarter'); await elementById('SpendingAmountContinue').waitForEnabled(); await sleep(500); From 1f38b6f375cb92e81b3abba4b5cbd30aabab4d0d Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 28 Nov 2025 13:59:34 +0100 Subject: [PATCH 39/50] lightning stability sleep --- test/specs/lightning.e2e.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/test/specs/lightning.e2e.ts b/test/specs/lightning.e2e.ts index c4b2041..cd92c45 100644 --- a/test/specs/lightning.e2e.ts +++ b/test/specs/lightning.e2e.ts @@ -131,6 +131,7 @@ describe('@lightning - Lightning', () => { await tap('ReceiveTagsSubmit'); await sleep(300); await tap('ShowQrReceive'); + await sleep(500); const invoice2 = await getAddressFromQRCode('lightning'); await swipeFullScreen('down'); await lnd.sendPaymentSync({ paymentRequest: invoice2 }); From bd481f0b5176ff62414839a4615cc9e7e7c4e10f Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 28 Nov 2025 16:28:18 +0100 Subject: [PATCH 40/50] lightning adjustments + stability --- test/helpers/lnd.ts | 1 + test/specs/lightning.e2e.ts | 4 +++- test/specs/numberpad.e2e.ts | 2 ++ test/specs/settings.e2e.ts | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/test/helpers/lnd.ts b/test/helpers/lnd.ts index d8242c2..fb8056b 100644 --- a/test/helpers/lnd.ts +++ b/test/helpers/lnd.ts @@ -103,6 +103,7 @@ export async function getLDKNodeID(): Promise { await elementById('LDKNodeID').waitForDisplayed({ timeout: 60_000 }); const ldkNodeId = (await elementById('LDKNodeID').getText()).trim(); console.info({ ldkNodeId }); + await sleep(500); await tap('NavigationBack'); return ldkNodeId; } diff --git a/test/specs/lightning.e2e.ts b/test/specs/lightning.e2e.ts index cd92c45..d6161d3 100644 --- a/test/specs/lightning.e2e.ts +++ b/test/specs/lightning.e2e.ts @@ -98,6 +98,7 @@ describe('@lightning - Lightning', () => { // Toast message await expectText('Spending Balance Ready'); + await expectText('Spending Balance Ready', { visible: false }); // check channel status await checkChannelStatus(); @@ -117,6 +118,7 @@ describe('@lightning - Lightning', () => { // send funds to LDK, 111 sats invoice await tap('Receive'); + await sleep(1000); await tap('SpecifyInvoiceButton'); await tap('ReceiveNumberPadTextField'); await sleep(100); @@ -270,12 +272,12 @@ describe('@lightning - Lightning', () => { // close channel await tap('CloseConnection'); await tap('CloseConnectionButton'); + await acknowledgeReceivedPayment(); await elementByText('Transfer Initiated').waitForDisplayed(); await elementByText('Transfer Initiated').waitForDisplayed({ reverse: true }); await mineBlocks(rpc, 6); await electrum?.waitForSync(); - await acknowledgeReceivedPayment(); await elementById('Channel').waitForDisplayed({ reverse: true }); await tap('NavigationBack'); await doNavigationClose(); diff --git a/test/specs/numberpad.e2e.ts b/test/specs/numberpad.e2e.ts index 2da5a7e..7cadef3 100644 --- a/test/specs/numberpad.e2e.ts +++ b/test/specs/numberpad.e2e.ts @@ -24,6 +24,7 @@ describe('@numberpad - NumberPad', () => { describe('Modern denomination', () => { ciIt('@numberpad_1 - Receive: Can enter amounts in modern denomination', async () => { await tap('Receive'); + await sleep(700); await tap('SpecifyInvoiceButton'); await tap('ReceiveNumberPadTextField'); await sleep(700); @@ -45,6 +46,7 @@ describe('@numberpad - NumberPad', () => { ciIt('@numberpad_3 - Receive: Can enter amounts in classic denomination', async () => { await tap('Receive'); + await sleep(700); await tap('SpecifyInvoiceButton'); await tap('ReceiveNumberPadTextField'); await sleep(700); diff --git a/test/specs/settings.e2e.ts b/test/specs/settings.e2e.ts index 2035f83..ddc7478 100644 --- a/test/specs/settings.e2e.ts +++ b/test/specs/settings.e2e.ts @@ -154,6 +154,7 @@ describe('@settings - Settings', () => { // open receive tags, add a tag const tag = 'test123'; await tap('Receive'); + await sleep(700); await tap('SpecifyInvoiceButton'); (await elementByText(tag)).waitForDisplayed({ reverse: true }); @@ -177,6 +178,7 @@ describe('@settings - Settings', () => { // open receive tags, check tags are gone await tap('Receive'); + await sleep(700); await tap('SpecifyInvoiceButton'); (await elementByText(tag)).waitForDisplayed({ reverse: true }); await tap('TagsAdd'); From 79a2efa6d89de459636bcce0e421769a6fee4135 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 28 Nov 2025 16:44:00 +0100 Subject: [PATCH 41/50] waitForBackup in lightning --- test/specs/lightning.e2e.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/specs/lightning.e2e.ts b/test/specs/lightning.e2e.ts index d6161d3..1642a3a 100644 --- a/test/specs/lightning.e2e.ts +++ b/test/specs/lightning.e2e.ts @@ -24,6 +24,7 @@ import { dismissQuickPayIntro, doNavigationClose, acknowledgeReceivedPayment, + waitForBackup, } from '../helpers/actions'; import { reinstallApp } from '../helpers/setup'; import { bitcoinURL, lndConfig } from '../helpers/constants'; @@ -238,8 +239,7 @@ describe('@lightning - Lightning', () => { // wipe and restore wallet const seed = await getSeed(); - // await waitForBackup(); - await sleep(10_000); //temp wait (until we have a proper event for backup completion) + await waitForBackup(); await restoreWallet(seed); // check balance @@ -264,6 +264,7 @@ describe('@lightning - Lightning', () => { await tap('DrawerSettings'); await tap('AdvancedSettings'); await tap('Channels'); + await sleep(500); await tap('Channel'); await expectTextWithin('TotalSize', '₿ 100 000'); await swipeFullScreen('up'); From 08a779c7c8bb324e4bb005a9342de6a992fd0601 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Mon, 1 Dec 2025 15:31:02 +0100 Subject: [PATCH 42/50] RGS and Electrum toast ids --- test/helpers/actions.ts | 9 ++++++++- test/specs/settings.e2e.ts | 28 +++++++--------------------- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index e6109d8..1efdcbb 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -674,14 +674,21 @@ export async function receiveOnchainFunds( } type ToastId = + | 'RgsUpdatedToast' + | 'RgsErrorToast' + | 'ElectrumErrorToast' + | 'ElectrumUpdatedToast' | 'PaymentFailedToast' | 'ReceivedTransactionReplacedToast' | 'TransactionReplacedToast' | 'TransactionUnconfirmedToast' | 'TransactionRemovedToast'; -export async function waitForToast(toastId: ToastId) { +export async function waitForToast(toastId: ToastId, { waitToDisappear = true } = {}) { await elementById(toastId).waitForDisplayed(); + if (waitToDisappear) { + await elementById(toastId).waitForDisplayed({ reverse: true, timeout: 15_000 }); + } } /** Acknowledges the received payment notification by tapping the button. diff --git a/test/specs/settings.e2e.ts b/test/specs/settings.e2e.ts index ddc7478..93bbf6d 100644 --- a/test/specs/settings.e2e.ts +++ b/test/specs/settings.e2e.ts @@ -14,8 +14,8 @@ import { confirmInputOnKeyboard, multiTap, getAccessibleText, - expectText, doNavigationClose, + waitForToast, } from '../helpers/actions'; import { electrumHost, electrumPort } from '../helpers/constants'; import { launchFreshApp, reinstallApp } from '../helpers/setup'; @@ -380,7 +380,7 @@ describe('@settings - Settings', () => { // disconnected warning should appear await elementById('Disconnected').waitForDisplayed(); - await sleep(1000); + await waitForToast('ElectrumErrorToast'); // scanner - check all possible connection formats // Umbrel format @@ -397,20 +397,6 @@ describe('@settings - Settings', () => { expectedProtocol: 'TLS', }; - // should detect protocol for common ports - const noProto1 = { - url: `${electrumHost}:50001`, - expectedHost: electrumHost, - expectedPort: '50001', - expectedProtocol: 'TCP', - }; - const noProto2 = { - url: `${electrumHost}:50002`, - expectedHost: electrumHost, - expectedPort: '50002', - expectedProtocol: 'TLS', - }; - // HTTP URL const http1 = { url: `http://${electrumHost}:${electrumPort}`, @@ -425,7 +411,7 @@ describe('@settings - Settings', () => { expectedProtocol: 'TLS', }; - const conns = [umbrel1, umbrel2, noProto1, noProto2, http1, http2]; + const conns = [umbrel1, umbrel2, http1, http2]; let i = 0; for (const conn of conns) { await sleep(1000); @@ -437,6 +423,7 @@ describe('@settings - Settings', () => { await tap('ScanPrompt'); await typeText('QRInput', conn.url); await tap('DialogConfirm'); + await waitForToast('ElectrumUpdatedToast'); await expect(await elementById('HostInput')).toHaveText(conn.expectedHost); expect(await elementById('PortInput')).toHaveText(conn.expectedPort); // await expectTextWithin('ElectrumProtocol', conn.expectedProtocol); @@ -447,6 +434,7 @@ describe('@settings - Settings', () => { await elementById('ResetToDefault').waitForEnabled(); await tap('ResetToDefault'); await tap('ConnectToHost'); + await waitForToast('ElectrumUpdatedToast', { waitToDisappear: false }); await elementById('Connected').waitForDisplayed(); await sleep(1000); }); @@ -467,16 +455,14 @@ describe('@settings - Settings', () => { await typeText('RGSUrl', newUrl); await confirmInputOnKeyboard(); await tap('ConnectToHost'); - const updatedMsg = 'Rapid-Gossip-Sync Server Updated'; - await expectText(updatedMsg); - await expectText(updatedMsg, { visible: false }); + await waitForToast('RgsUpdatedToast'); const updatedUrl = await (await elementById('ConnectedUrl')).getText(); await expect(updatedUrl).toBe(newUrl); // switch back to default await tap('ResetToDefault'); await tap('ConnectToHost'); - await expectText(updatedMsg); + await waitForToast('RgsUpdatedToast', { waitToDisappear: false }); const resetUrl = await (await elementById('ConnectedUrl')).getText(); await expect(resetUrl).toBe(rgsUrl); From 7080f52c1d89f696e5511f9cd8b3e16b36071153 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Mon, 1 Dec 2025 17:24:47 +0100 Subject: [PATCH 43/50] adjust settings_10 --- test/helpers/actions.ts | 4 ++-- test/specs/settings.e2e.ts | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 1efdcbb..680779a 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -673,7 +673,7 @@ export async function receiveOnchainFunds( } } -type ToastId = +export type ToastId = | 'RgsUpdatedToast' | 'RgsErrorToast' | 'ElectrumErrorToast' @@ -687,7 +687,7 @@ type ToastId = export async function waitForToast(toastId: ToastId, { waitToDisappear = true } = {}) { await elementById(toastId).waitForDisplayed(); if (waitToDisappear) { - await elementById(toastId).waitForDisplayed({ reverse: true, timeout: 15_000 }); + await elementById(toastId).waitForDisplayed({ reverse: true }); } } diff --git a/test/specs/settings.e2e.ts b/test/specs/settings.e2e.ts index 93bbf6d..66057fe 100644 --- a/test/specs/settings.e2e.ts +++ b/test/specs/settings.e2e.ts @@ -16,6 +16,7 @@ import { getAccessibleText, doNavigationClose, waitForToast, + ToastId, } from '../helpers/actions'; import { electrumHost, electrumPort } from '../helpers/constants'; import { launchFreshApp, reinstallApp } from '../helpers/setup'; @@ -389,12 +390,14 @@ describe('@settings - Settings', () => { expectedHost: electrumHost, expectedPort: electrumPort.toString(), expectedProtocol: 'TCP', + expectedToastMessage: 'ElectrumUpdatedToast', }; const umbrel2 = { url: `${electrumHost}:${electrumPort}:s`, expectedHost: electrumHost, expectedPort: electrumPort.toString(), expectedProtocol: 'TLS', + expectedToastMessage: driver.isAndroid ? 'ElectrumErrorToast' : 'ElectrumUpdatedToast', }; // HTTP URL @@ -403,17 +406,20 @@ describe('@settings - Settings', () => { expectedHost: electrumHost, expectedPort: electrumPort.toString(), expectedProtocol: 'TCP', + expectedToastMessage: 'ElectrumUpdatedToast', }; const http2 = { url: `https://${electrumHost}:${electrumPort}`, expectedHost: electrumHost, expectedPort: electrumPort.toString(), expectedProtocol: 'TLS', + expectedToastMessage: driver.isAndroid ? 'ElectrumErrorToast' : 'ElectrumUpdatedToast', }; const conns = [umbrel1, umbrel2, http1, http2]; let i = 0; for (const conn of conns) { + console.info(`Testing Electrum connection format #${i + 1}: ${conn.url}`); await sleep(1000); await tap('NavigationAction'); // on the first time we need to accept the notifications permission dialog to use camera @@ -423,7 +429,7 @@ describe('@settings - Settings', () => { await tap('ScanPrompt'); await typeText('QRInput', conn.url); await tap('DialogConfirm'); - await waitForToast('ElectrumUpdatedToast'); + await waitForToast(conn.expectedToastMessage as ToastId); await expect(await elementById('HostInput')).toHaveText(conn.expectedHost); expect(await elementById('PortInput')).toHaveText(conn.expectedPort); // await expectTextWithin('ElectrumProtocol', conn.expectedProtocol); @@ -434,7 +440,9 @@ describe('@settings - Settings', () => { await elementById('ResetToDefault').waitForEnabled(); await tap('ResetToDefault'); await tap('ConnectToHost'); - await waitForToast('ElectrumUpdatedToast', { waitToDisappear: false }); + if (driver.isIOS) { + await waitForToast('ElectrumUpdatedToast', { waitToDisappear: false }); + } await elementById('Connected').waitForDisplayed(); await sleep(1000); }); From 9f5a835e653c981744f00e4256f406db2490fd6d Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 3 Dec 2025 15:27:20 +0100 Subject: [PATCH 44/50] adjust lightning --- test/specs/lightning.e2e.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/specs/lightning.e2e.ts b/test/specs/lightning.e2e.ts index 1642a3a..4562398 100644 --- a/test/specs/lightning.e2e.ts +++ b/test/specs/lightning.e2e.ts @@ -264,8 +264,9 @@ describe('@lightning - Lightning', () => { await tap('DrawerSettings'); await tap('AdvancedSettings'); await tap('Channels'); - await sleep(500); + await sleep(2000); await tap('Channel'); + await sleep(1000); await expectTextWithin('TotalSize', '₿ 100 000'); await swipeFullScreen('up'); await elementById('IsUsableYes').waitForDisplayed(); @@ -273,7 +274,6 @@ describe('@lightning - Lightning', () => { // close channel await tap('CloseConnection'); await tap('CloseConnectionButton'); - await acknowledgeReceivedPayment(); await elementByText('Transfer Initiated').waitForDisplayed(); await elementByText('Transfer Initiated').waitForDisplayed({ reverse: true }); From 67f502b8d9b22cd9f641a48a558224c665ddbada Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 3 Dec 2025 10:39:37 +0100 Subject: [PATCH 45/50] add Balance toast ids and dismiss to waitForToast --- test/helpers/actions.ts | 14 ++++++++++---- test/specs/settings.e2e.ts | 3 +++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 680779a..0140c75 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -651,9 +651,6 @@ export async function receiveOnchainFunds( await acknowledgeReceivedPayment(); await mineBlocks(rpc, blocksToMine); - // if (blocksToMine > 0) { - // await waitForToast('PaymentConfirmedToast'); - // } if (driver.isAndroid) { await dismissBackupTimedSheet(); @@ -674,6 +671,8 @@ export async function receiveOnchainFunds( } export type ToastId = + | 'BalanceUnitSwitchedToast' + | 'BalanceHiddenToast' | 'RgsUpdatedToast' | 'RgsErrorToast' | 'ElectrumErrorToast' @@ -684,10 +683,17 @@ export type ToastId = | 'TransactionUnconfirmedToast' | 'TransactionRemovedToast'; -export async function waitForToast(toastId: ToastId, { waitToDisappear = true } = {}) { +export async function waitForToast( + toastId: ToastId, + { waitToDisappear = false, dismiss = true } = {} +) { await elementById(toastId).waitForDisplayed(); if (waitToDisappear) { await elementById(toastId).waitForDisplayed({ reverse: true }); + return; + } + if (dismiss) { + await dragOnElement(toastId, 'up', 0.2); } } diff --git a/test/specs/settings.e2e.ts b/test/specs/settings.e2e.ts index 66057fe..bfe7fa2 100644 --- a/test/specs/settings.e2e.ts +++ b/test/specs/settings.e2e.ts @@ -218,6 +218,9 @@ describe('@settings - Settings', () => { await dragOnElement('TotalBalance', 'right', 0.5); } await elementById('ShowBalance').waitForDisplayed(); + if (driver.isIOS) { + await waitForToast('BalanceHiddenToast', { waitToDisappear: false, dismiss: true }); + } // Disable 'swipe to hide balance' await tap('HeaderMenu'); From 5949f58cf40ce1cc81363588222140b3df2bb054 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 3 Dec 2025 11:31:33 +0100 Subject: [PATCH 46/50] remove tapBalanceToReset in launchFreshApp --- test/helpers/setup.ts | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/test/helpers/setup.ts b/test/helpers/setup.ts index bfcbfd8..a66dca9 100644 --- a/test/helpers/setup.ts +++ b/test/helpers/setup.ts @@ -1,32 +1,13 @@ import { execSync } from 'node:child_process'; -import { elementsById, sleep, tap } from './actions'; +import { sleep } from './actions'; import { getAppId, getAppPath } from './constants'; -export async function launchFreshApp({ tryHandleAlert = true } = {}) { +export async function launchFreshApp() { const appId = getAppId(); await driver.terminateApp(appId); await driver.activateApp(appId); - // workaround to get rid of "Bitkit is running in background" alert - if (tryHandleAlert) { - await sleep(1000); - try { - await tapBalanceToReset(); - } catch { - await tapBalanceToReset(); - } - } - await sleep(500); -} - -async function tapBalanceToReset() { - await tap('TotalBalance'); - const moneyFiatSymbols = await elementsById('MoneyFiatSymbol'); - moneyFiatSymbols[0].waitForDisplayed(); - moneyFiatSymbols[1].waitForDisplayed(); - if ((await moneyFiatSymbols[1].getText()) !== '₿') { - await tap('TotalBalance'); - } + await sleep(3000); } /** From 671ed9d5c2e7e8b9fb1eba812cec30a043c20e49 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 3 Dec 2025 11:32:03 +0100 Subject: [PATCH 47/50] add BalanceUnitSwitchedToast --- test/specs/settings.e2e.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/specs/settings.e2e.ts b/test/specs/settings.e2e.ts index bfe7fa2..7f9d9d9 100644 --- a/test/specs/settings.e2e.ts +++ b/test/specs/settings.e2e.ts @@ -43,6 +43,9 @@ describe('@settings - Settings', () => { await tap('TotalBalance'); } await expect(fiatSymbol).toHaveText('$'); + if (driver.isIOS) { + await waitForToast('BalanceUnitSwitchedToast'); + } // - change settings (currency to EUR) // await tap('HeaderMenu'); @@ -132,6 +135,7 @@ describe('@settings - Settings', () => { await tap('N1'); await tap('Continue'); await tap('NavigationBack'); + await sleep(1000); await expect(await elementByIdWithin('TransactionSpeedSettings', 'Value')).toHaveText( /.*Custom/ ); @@ -245,7 +249,7 @@ describe('@settings - Settings', () => { // Restart the app await sleep(3000); - await launchFreshApp({ tryHandleAlert: driver.isAndroid }); + await launchFreshApp(); // Balance should be hidden await elementById('ShowBalance').waitForDisplayed(); }); @@ -259,6 +263,7 @@ describe('@settings - Settings', () => { await sleep(1000); await tap('ResetAndRestore'); await tap('NavigationBack'); + await sleep(1000); await tap('BackupWallet'); await sleep(1000); // animation From bbe15d5f35b486cefbb0ec183794f4ae7f75ab7b Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 3 Dec 2025 11:39:47 +0100 Subject: [PATCH 48/50] disable check for iOS (bitkit-ios/issues/260) --- test/specs/settings.e2e.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/specs/settings.e2e.ts b/test/specs/settings.e2e.ts index 7f9d9d9..7bf14f2 100644 --- a/test/specs/settings.e2e.ts +++ b/test/specs/settings.e2e.ts @@ -251,7 +251,10 @@ describe('@settings - Settings', () => { await sleep(3000); await launchFreshApp(); // Balance should be hidden - await elementById('ShowBalance').waitForDisplayed(); + // https://github.com/synonymdev/bitkit-ios/issues/260 + if (driver.isAndroid) { + await elementById('ShowBalance').waitForDisplayed(); + } }); }); From fabf726dd1ee68efeaa43a82f8036e44584efb72 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 3 Dec 2025 12:59:07 +0100 Subject: [PATCH 49/50] stability --- test/specs/settings.e2e.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/specs/settings.e2e.ts b/test/specs/settings.e2e.ts index 7bf14f2..c7fd800 100644 --- a/test/specs/settings.e2e.ts +++ b/test/specs/settings.e2e.ts @@ -125,6 +125,7 @@ describe('@settings - Settings', () => { // switch to Fast await tap('TransactionSpeedSettings'); await tap('fast'); + await sleep(1000); await expect(await elementByIdWithin('TransactionSpeedSettings', 'Value')).toHaveText( /.*Fast/ ); @@ -143,6 +144,7 @@ describe('@settings - Settings', () => { // switch back to Normal await tap('TransactionSpeedSettings'); await tap('normal'); + await sleep(1000); await expect(await elementByIdWithin('TransactionSpeedSettings', 'Value')).toHaveText( /.*Normal/ ); @@ -265,6 +267,7 @@ describe('@settings - Settings', () => { await tap('BackupSettings'); await sleep(1000); await tap('ResetAndRestore'); + await sleep(1000); await tap('NavigationBack'); await sleep(1000); await tap('BackupWallet'); From 7a264aaecec7fd6122f84ec57765ecb234257dd9 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Wed, 3 Dec 2025 13:40:42 +0100 Subject: [PATCH 50/50] adjust settings_10 after ios fix --- test/specs/settings.e2e.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/specs/settings.e2e.ts b/test/specs/settings.e2e.ts index c7fd800..e98ec85 100644 --- a/test/specs/settings.e2e.ts +++ b/test/specs/settings.e2e.ts @@ -394,7 +394,6 @@ describe('@settings - Settings', () => { await tap('ConnectToHost'); // disconnected warning should appear - await elementById('Disconnected').waitForDisplayed(); await waitForToast('ElectrumErrorToast'); // scanner - check all possible connection formats @@ -411,7 +410,7 @@ describe('@settings - Settings', () => { expectedHost: electrumHost, expectedPort: electrumPort.toString(), expectedProtocol: 'TLS', - expectedToastMessage: driver.isAndroid ? 'ElectrumErrorToast' : 'ElectrumUpdatedToast', + expectedToastMessage: 'ElectrumErrorToast', }; // HTTP URL @@ -427,7 +426,7 @@ describe('@settings - Settings', () => { expectedHost: electrumHost, expectedPort: electrumPort.toString(), expectedProtocol: 'TLS', - expectedToastMessage: driver.isAndroid ? 'ElectrumErrorToast' : 'ElectrumUpdatedToast', + expectedToastMessage: 'ElectrumErrorToast', }; const conns = [umbrel1, umbrel2, http1, http2];