Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions test/helpers/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,9 @@ export async function receiveOnchainFunds(
// send - onchain - receiver sees no confetti — missing-in-ldk-node missing onchain payment event
// await elementById('ReceivedTransaction').waitForDisplayed();

await dismissBackupTimedSheet();
await dismissBackupTimedSheet({ triggerTimedSheet: driver.isIOS });
if (expectHighBalanceWarning) {
await acknowledgeHighBalanceWarning();
await acknowledgeHighBalanceWarning({ triggerTimedSheet: driver.isIOS });
}
const moneyText = await elementByIdWithin('TotalBalance-primary', 'MoneyText');
await expect(moneyText).toHaveText(formattedSats);
Expand Down Expand Up @@ -677,13 +677,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);
}

Expand Down Expand Up @@ -733,13 +732,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);
}

Expand Down
61 changes: 42 additions & 19 deletions test/specs/boost.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -77,13 +77,25 @@ describe('@boost - Boost', () => {
// 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');
Expand All @@ -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 --- //

Expand All @@ -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();

Expand All @@ -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 () => {
Expand Down