Skip to content

Commit 67f502b

Browse files
committed
add Balance toast ids and dismiss to waitForToast
1 parent 9f5a835 commit 67f502b

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

test/helpers/actions.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,9 +651,6 @@ export async function receiveOnchainFunds(
651651
await acknowledgeReceivedPayment();
652652

653653
await mineBlocks(rpc, blocksToMine);
654-
// if (blocksToMine > 0) {
655-
// await waitForToast('PaymentConfirmedToast');
656-
// }
657654

658655
if (driver.isAndroid) {
659656
await dismissBackupTimedSheet();
@@ -674,6 +671,8 @@ export async function receiveOnchainFunds(
674671
}
675672

676673
export type ToastId =
674+
| 'BalanceUnitSwitchedToast'
675+
| 'BalanceHiddenToast'
677676
| 'RgsUpdatedToast'
678677
| 'RgsErrorToast'
679678
| 'ElectrumErrorToast'
@@ -684,10 +683,17 @@ export type ToastId =
684683
| 'TransactionUnconfirmedToast'
685684
| 'TransactionRemovedToast';
686685

687-
export async function waitForToast(toastId: ToastId, { waitToDisappear = true } = {}) {
686+
export async function waitForToast(
687+
toastId: ToastId,
688+
{ waitToDisappear = false, dismiss = true } = {}
689+
) {
688690
await elementById(toastId).waitForDisplayed();
689691
if (waitToDisappear) {
690692
await elementById(toastId).waitForDisplayed({ reverse: true });
693+
return;
694+
}
695+
if (dismiss) {
696+
await dragOnElement(toastId, 'up', 0.2);
691697
}
692698
}
693699

test/specs/settings.e2e.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ describe('@settings - Settings', () => {
218218
await dragOnElement('TotalBalance', 'right', 0.5);
219219
}
220220
await elementById('ShowBalance').waitForDisplayed();
221+
if (driver.isIOS) {
222+
await waitForToast('BalanceHiddenToast', { waitToDisappear: false, dismiss: true });
223+
}
221224

222225
// Disable 'swipe to hide balance'
223226
await tap('HeaderMenu');

0 commit comments

Comments
 (0)