Skip to content

Commit

Permalink
fix: smart tx closure
Browse files Browse the repository at this point in the history
Signed-off-by: r3kt.eth <so@r3kt.io>
  • Loading branch information
r3kt-eth committed May 30, 2024
1 parent e2bdb2a commit 2fca89d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions commands/metamask.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 2fca89d

Please sign in to comment.