diff --git a/package.json b/package.json index 04043943..11011fba 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "branches": [ "main", { - "name": "develop", + "name": "feat/add_cancel_tx", "channel": "alpha", "prerelease": "alpha" } diff --git a/packages/wallets/src/metamask/metamask.page.ts b/packages/wallets/src/metamask/metamask.page.ts index 82122392..e9b28ace 100644 --- a/packages/wallets/src/metamask/metamask.page.ts +++ b/packages/wallets/src/metamask/metamask.page.ts @@ -61,6 +61,23 @@ export class MetamaskPage implements WalletPage { }); } + async cancelAllTxInQueue() { + await test.step('Force close all transactions', async () => { + await test.step('Close all extension pages', async () => { + const pages = await this.browserContext.pages(); + await Promise.all([ + pages.map((page) => { + if (page.url().startsWith('chrome-extension://')) page.close(); + }), + ]); + }); + await this.homePage.openWidgetPage(); + await this.header.appHeaderLogo.waitFor({ state: 'visible' }); + await this.walletOperation.cancelAllTxInQueue(); // reject all tx in queue if exist + await this.page.close(); + }); + } + async setup() { await test.step('Setup', async () => { // added explicit route to #onboarding due to unexpected first time route from /home.html to /onboarding ---> page is close diff --git a/packages/wallets/src/wallet.page.ts b/packages/wallets/src/wallet.page.ts index a989fdd5..f3c9e10c 100644 --- a/packages/wallets/src/wallet.page.ts +++ b/packages/wallets/src/wallet.page.ts @@ -17,6 +17,8 @@ export interface WalletPage { cancelTx?(page: Page): Promise; + cancelAllTxInQueue?(): Promise; + approveTokenTx?(page: Page): Promise; openLastTxInEthplorer?(txIndex?: number): Promise;