Skip to content

Commit

Permalink
fix: smart tx confirmation
Browse files Browse the repository at this point in the history
Signed-off-by: r3kt.eth <[email protected]>
  • Loading branch information
r3kt-eth committed May 30, 2024
1 parent 1210c91 commit f3871d7
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 f3871d7

Please sign in to comment.