diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 4fbac95..2230512 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -541,6 +541,7 @@ export async function restoreWallet( type addressType = 'bitcoin' | 'lightning'; export async function getReceiveAddress(which: addressType = 'bitcoin'): Promise { await tap('Receive'); + await sleep(500); return getAddressFromQRCode(which); } @@ -635,12 +636,22 @@ export async function receiveOnchainFunds( // send - onchain - receiver sees no confetti — missing-in-ldk-node missing onchain payment event // await elementById('ReceivedTransaction').waitForDisplayed(); - await dismissBackupTimedSheet(); - if (expectHighBalanceWarning) { - await acknowledgeHighBalanceWarning(); + if (driver.isAndroid) { + await dismissBackupTimedSheet(); + if (expectHighBalanceWarning) { + await acknowledgeHighBalanceWarning(); + } } + const moneyText = await elementByIdWithin('TotalBalance-primary', 'MoneyText'); await expect(moneyText).toHaveText(formattedSats); + + if (driver.isIOS) { + await dismissBackupTimedSheet({ triggerTimedSheet: true }); + if (expectHighBalanceWarning) { + await acknowledgeHighBalanceWarning({ triggerTimedSheet: true }); + } + } } /** @@ -677,13 +688,12 @@ export async function doTriggerTimedSheet() { export async function dismissBackupTimedSheet({ triggerTimedSheet = false, }: { triggerTimedSheet?: boolean } = {}) { - if (driver.isIOS) return; // Not supported on iOS yet if (triggerTimedSheet) { await doTriggerTimedSheet(); } - await elementById('backup_description').waitForDisplayed(); + await elementById('BackupIntroViewDescription').waitForDisplayed(); await sleep(500); // wait for the app to settle - await tap('later_button'); + await tap('BackupIntroViewCancel'); await sleep(500); } @@ -733,13 +743,12 @@ export async function dismissQuickPayIntro({ export async function acknowledgeHighBalanceWarning({ triggerTimedSheet = false, }: { triggerTimedSheet?: boolean } = {}) { - if (driver.isIOS) return; // Not supported on iOS yet if (triggerTimedSheet) { await doTriggerTimedSheet(); } - await elementById('high_balance_image').waitForDisplayed(); - await tap('understood_button'); - await elementById('high_balance_image').waitForDisplayed({ reverse: true }); + await elementById('HighBalanceSheetDescription').waitForDisplayed(); + await tap('HighBalanceSheetContinue'); + await elementById('HighBalanceSheetDescription').waitForDisplayed({ reverse: true }); await sleep(500); } diff --git a/test/specs/boost.e2e.ts b/test/specs/boost.e2e.ts index bd82dd6..bf64675 100644 --- a/test/specs/boost.e2e.ts +++ b/test/specs/boost.e2e.ts @@ -59,7 +59,7 @@ describe('@boost - Boost', () => { // old tx await tap('ActivityShort-0'); - await expectText('100 000'); + await expectText('100 000', { strategy: 'contains' }); await tap('ActivityTxDetails'); const origTxId = await getTextUnder('TXID'); console.info({ oldTxId: origTxId }); @@ -71,19 +71,31 @@ describe('@boost - Boost', () => { await tap('CustomFeeButton'); await tap('Plus'); await tap('Minus'); - await tap('RecomendedFeeButton'); + await tap('RecommendedFeeButton'); await dragOnElement('GRAB', 'right', 0.95); // Swipe to confirm // check Activity await elementById('BoostingIcon').waitForDisplayed(); await elementById('ActivityShort-0').waitForDisplayed(); - await expect(elementById('ActivityShort-1')).toBeDisplayed(); - await expect(elementById('ActivityShort-2')).not.toBeDisplayed(); + + // no additional boost tx item on iOS, there is one on Android + const showsBoostTxItem = driver.isAndroid; + 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(); + } // orig tx still there await swipeFullScreen('up'); - await tap('ActivityShort-1'); - await expectText('100 000'); + if (showsBoostTxItem) { + await tap('ActivityShort-1'); + } else { + await tap('ActivityShort-0'); + } + await expectText('100 000', { strategy: 'contains' }); await elementById('BoostedButton').waitForDisplayed(); await elementById('StatusBoosting').waitForDisplayed(); await tap('ActivityTxDetails'); @@ -95,15 +107,17 @@ describe('@boost - Boost', () => { console.info({ parentTxId }); await doNavigationClose(); - // 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(); + 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(); + } // --- skip due to: https://github.com/synonymdev/bitkit-android/issues/321 --- // @@ -119,8 +133,13 @@ describe('@boost - Boost', () => { // check activity after restore await swipeFullScreen('up'); await elementById('BoostingIcon').waitForDisplayed(); - await elementById('ActivityShort-1').waitForDisplayed(); - await tap('ActivityShort-1'); + if (showsBoostTxItem) { + await elementById('ActivityShort-1').waitForDisplayed(); + await tap('ActivityShort-1'); + } else { + await elementById('ActivityShort-0').waitForDisplayed(); + await tap('ActivityShort-0'); + } await elementById('BoostedButton').waitForDisplayed(); await elementById('StatusBoosting').waitForDisplayed(); @@ -135,14 +154,18 @@ describe('@boost - Boost', () => { await attemptRefreshOnHomeScreen(); await swipeFullScreen('up'); await elementById('ActivityShort-0').waitForDisplayed(); - await elementById('ActivityShort-1').waitForDisplayed(); + if (showsBoostTxItem) { + await elementById('ActivityShort-1').waitForDisplayed(); + } // TEMP: refresh until proper events available await tap('ActivityShort-0'); await elementById('StatusConfirmed').waitForDisplayed(); await doNavigationClose(); - await tap('ActivityShort-1'); - await elementById('StatusConfirmed').waitForDisplayed(); + if (showsBoostTxItem) { + await tap('ActivityShort-1'); + await elementById('StatusConfirmed').waitForDisplayed(); + } }); ciIt('@boost_2 - Can do RBF', async () => { @@ -205,7 +228,7 @@ describe('@boost - Boost', () => { await tap('CustomFeeButton'); await tap('Plus'); await tap('Minus'); - await tap('RecomendedFeeButton'); + await tap('RecommendedFeeButton'); await dragOnElement('GRAB', 'right', 0.95); // Swipe to confirm // check Activity