Skip to content

Commit 2fca89d

Browse files
committed
fix: smart tx closure
Signed-off-by: r3kt.eth <so@r3kt.io>
1 parent e2bdb2a commit 2fca89d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

commands/metamask.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,15 @@ const metamask = {
150150
// note: this is required for fast execution of e2e tests to avoid flakiness
151151
// otherwise popup may not be detected properly and not closed
152152
await playwright.metamaskWindow().waitForTimeout(1000);
153+
154+
let smartTxOptInBtn =
155+
'.mm-smart-transactions-opt-in-modal .mm-box--rounded-pill';
156+
if (
157+
(await playwright.metamaskWindow().locator(smartTxOptInBtn).count()) > 0
158+
) {
159+
await playwright.waitAndClick(smartTxOptInBtn);
160+
}
161+
153162
if (
154163
(await playwright
155164
.metamaskWindow()
@@ -1535,10 +1544,6 @@ const metamask = {
15351544
await module.exports.importAccount(secretWordsOrPrivateKey);
15361545
}
15371546

1538-
// Enhanced Transaction Protection
1539-
await playwright.waitAndClick(
1540-
mainPageElements.accountModal.primaryButton,
1541-
);
15421547
await setupSettings(enableAdvancedSettings, enableExperimentalSettings);
15431548

15441549
await module.exports.changeNetwork(network);

0 commit comments

Comments
 (0)