diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index ae045e4..1813e98 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -1444,6 +1444,23 @@ export async function acknowledgeReceivedPayment({ timeout = 30_000 }: { timeout await sleep(300); } +/** Dismisses the received payment sheet when it shows, and does nothing when it does not. + * + * Use this where the sheet is platform- or build-dependent, such as a deposit the wallet first sees + * already confirmed (synonymdev/bitkit-android#797), which Android notifies and iOS does not yet. + */ +export async function dismissReceivedPaymentIfShown({ + timeout = 20_000, +}: { timeout?: number } = {}): Promise { + try { + await acknowledgeReceivedPayment({ timeout }); + return true; + } catch { + console.info('→ No received payment sheet shown, continuing.'); + return false; + } +} + export async function acknowledgeReceivedPaymentIfPresent(): Promise { if (getBackend() === 'local') { await acknowledgeReceivedPayment(); diff --git a/test/specs/boost.e2e.ts b/test/specs/boost.e2e.ts index e7abf5a..e2c9c97 100644 --- a/test/specs/boost.e2e.ts +++ b/test/specs/boost.e2e.ts @@ -15,6 +15,7 @@ import { restoreWallet, enterAddress, waitForToast, + dismissReceivedPaymentIfShown, } from '../helpers/actions'; import initElectrum from '../helpers/electrum'; import { reinstallApp } from '../helpers/setup'; @@ -111,6 +112,11 @@ describe('@boost - Boost', () => { // mine new block await mineBlocks(1); + + // the restored wallet never saw the boosted tx in the mempool, so this confirmation is its + // first sight of the deposit and the received sheet opens over the screen + await dismissReceivedPaymentIfShown(); + await doNavigationClose(); await sleep(500);