From 2fca89d1fdc167267fd55e8d69337b79a18cffb1 Mon Sep 17 00:00:00 2001 From: "r3kt.eth" Date: Thu, 30 May 2024 12:21:31 +0200 Subject: [PATCH] fix: smart tx closure Signed-off-by: r3kt.eth --- commands/metamask.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/commands/metamask.js b/commands/metamask.js index bf60fe4f4..6044324de 100644 --- a/commands/metamask.js +++ b/commands/metamask.js @@ -150,6 +150,15 @@ const metamask = { // note: this is required for fast execution of e2e tests to avoid flakiness // otherwise popup may not be detected properly and not closed await playwright.metamaskWindow().waitForTimeout(1000); + + let smartTxOptInBtn = + '.mm-smart-transactions-opt-in-modal .mm-box--rounded-pill'; + if ( + (await playwright.metamaskWindow().locator(smartTxOptInBtn).count()) > 0 + ) { + await playwright.waitAndClick(smartTxOptInBtn); + } + if ( (await playwright .metamaskWindow() @@ -1535,10 +1544,6 @@ const metamask = { await module.exports.importAccount(secretWordsOrPrivateKey); } - // Enhanced Transaction Protection - await playwright.waitAndClick( - mainPageElements.accountModal.primaryButton, - ); await setupSettings(enableAdvancedSettings, enableExperimentalSettings); await module.exports.changeNetwork(network);