Skip to content

test: fix flaky test malicious-signatures inline alert click during smooth scroll - #47724

Merged
LeVinhGithub merged 2 commits into
mainfrom
harry/fix-flaky-malicious-signatures-inline-alert
Nov 9, 2026
Merged

LeVinhGithub merged 2 commits into
mainfrom
harry/fix-flaky-malicious-signatures-inline-alert

Conversation

@LeVinhGithub

@LeVinhGithub LeVinhGithub commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Description

Flake type: Race Conditions with React Re-renders

Root cause:

  • The test signs in and triggers a Sign-In with Ethereum request from a bad domain, which opens the signature confirmation screen.
  • At the top of the confirmation screen, the Request from row shows an inline warning button ([data-testid="inline-alert"]).
  • The test first clicks the scroll-to-bottom arrow (clickScrollToBottomButton()), which starts a smooth scroll down the confirmation page.
  • Immediately after, the test tries to click the top inline warning button (clickInlineAlert()) while the page is still scrolling down.
  • Because the scroll moves the top Request from row upward and out of view, the click misses the warning button.
  • The warning modal never opens, so the next step (acknowledgeAlert()) times out waiting for the modal checkbox.

Solution:

  • Wait for the inline warning button ([data-testid="inline-alert"]) to stop moving inside Confirmation.clickInlineAlert() before clicking it - so smooth scrolling or layout shifts cannot cause the click to miss.
  • Remove the extra confirmation.clickScrollToBottomButton() call before confirmation.clickInlineAlert() in the bad-domain signature test - so the page stays at the top when clicking the top inline warning, while scrollAndConfirmAndAssertConfirm(driver) still scrolls to the bottom before clicking Confirm.

Slack: https://consensys.slack.com/archives/CTQAGKY5V/p1794215081050339?thread_ts=1794212189.357149&cid=CTQAGKY5V

Changelog

CHANGELOG entry: null

Manual testing steps

  1. Build the test bundle with yarn start:test (or yarn build:test).
  2. Run the malicious signatures E2E spec:
SELENIUM_BROWSER=chrome yarn test:e2e:single test/e2e/tests/confirmations/signatures/malicious-signatures.spec.ts --browser=chrome
  1. Verify all 3 tests in Malicious Confirmation Signature - Bad Domain pass.

Screenshots/Recordings

image

Before

CI failure screenshot (test-failure-screenshot-4.png, MetaMask Dialog confirmation popup in Malicious Confirmation Signature - Bad Domain displays alert for domain binding and confirms): The SIWE Bad Domain confirmation popup is scrolled partway down to the Message card because clickScrollToBottomButton() triggered a smooth scroll immediately before clickInlineAlert(). The top Request from row containing the inline alert button ([data-testid="inline-alert"]) scrolled above the viewport while WebDriver tried to click it, so the alert modal ([data-testid="alert-modal-acknowledge-checkbox"]) never opened and the footer button is still showing Review alert.

After

No product UI change. The test clicks the top inline alert while it is stationary at the top of the confirmation popup (with Confirmation.clickInlineAlert() waiting for the button to stop moving before clicking), acknowledges the alert modal, and then scrolls to the bottom to confirm the signature.

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Test-only changes; no production UI or application logic.

Overview
Fixes a flaky malicious SIWE bad-domain E2E test where the inline warning at the top of the confirmation dialog was clicked while the page was still smoothly scrolling, so the click missed and the alert modal never opened.

Confirmation.clickInlineAlert() now waits for [data-testid="inline-alert"] to stop moving (same pattern as other confirmation page objects) before clicking.

In malicious-signatures.spec.ts, the test no longer calls clickScrollToBottomButton() before clickInlineAlert(); it acknowledges the top inline alert first, then uses the existing scrollAndConfirmAndAssertConfirm flow to scroll and confirm.

Reviewed by Cursor Bugbot for commit 153aeea. Bugbot is set up for automated code reviews on this repo. Configure here.

…mooth scroll

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamask-ci

metamask-ci Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

✨ Files requiring CODEOWNER review ✨

🧪 @MetaMask/qa (1 files, +1 -0)
  • 📁 test/
    • 📁 e2e/
      • 📁 page-objects/
        • 📁 pages/
          • 📁 confirmations/
            • 📄 confirmation.ts +1 -0

@metamask-ci metamask-ci Bot added the team-qa QA team label Nov 9, 2026
@metamask-ci

metamask-ci Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor
Builds ready [5d0a6fa] [reused from 22d3d74]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 2 warn · 🔴 3 fail)

Baseline (latest main): f693520 | Date: 11/3/2026 | Pipeline: 42601769757 | Baseline logs

Metricschrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 load_new_account(p95) [CI log]🔴 load_new_account(p95) [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]

Regressions (🔴 3 failures)

Interaction Benchmarks · Samples: 5 🔴 2
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 [CI log]
🔴 load_new_account
🔴 [CI log]
🔴 load_new_account
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ loadNewAccount/load_new_account: +182%
  • ↑ loadNewAccount/total: +182%
  • ↓ loadNewAccount/inp: -18%
  • ↑ loadNewAccount/lcp: +895%
  • ↑ loadNewAccount/cls: +297%
  • ↑ confirmTx/longTaskCount: +67%
  • ↑ confirmTx/longTaskTotalDuration: +70%
  • ↑ confirmTx/longTaskMaxDuration: +46%
  • ↑ confirmTx/tbt: +75%
  • ↓ confirmTx/inp: -21%
  • ↑ confirmTx/lcp: +905%
  • ↓ confirmTx/cls: -14%
  • ↑ bridgeUserActions/bridge_load_page: +128%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +39%
  • ↑ bridgeUserActions/longTaskCount: +36%
  • ↑ bridgeUserActions/longTaskTotalDuration: +74%
  • ↑ bridgeUserActions/longTaskMaxDuration: +53%
  • ↑ bridgeUserActions/tbt: +134%
  • ↑ bridgeUserActions/total: +16%
  • ↑ bridgeUserActions/lcp: +900%
  • ↑ bridgeUserActions/cls: +621%
  • ↑ loadNewAccount/load_new_account: +180%
  • ↑ loadNewAccount/total: +180%
  • ↓ loadNewAccount/inp: -25%
  • ↓ loadNewAccount/fcp: -53%
  • ↑ loadNewAccount/lcp: +1004%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↓ confirmTx/inp: -29%
  • ↓ confirmTx/fcp: -58%
  • ↑ confirmTx/lcp: +1003%
  • ↑ bridgeUserActions/bridge_load_page: +159%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +163%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +39%
  • ↑ bridgeUserActions/inp: +25%
  • ↓ bridgeUserActions/fcp: -52%
  • ↑ bridgeUserActions/lcp: +951%
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 loadScripts

📈 Results compared to the previous 5 runs on main

  • ↑ startupStandardHome/uiStartup: +85%
  • ↑ startupStandardHome/load: +117%
  • ↑ startupStandardHome/domContentLoaded: +118%
  • ↑ startupStandardHome/domInteractive: +38%
  • ↓ startupStandardHome/firstPaint: -45%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -29%
  • ↑ startupStandardHome/loadScripts: +116%
  • ↑ startupStandardHome/setupStore: +121%
  • ↑ startupStandardHome/numNetworkReqs: +11%
  • ↑ startupStandardHome/longTaskCount: +43%
  • ↑ startupStandardHome/longTaskTotalDuration: +115%
  • ↑ startupStandardHome/longTaskMaxDuration: +116%
  • ↑ startupStandardHome/tbt: +139%
  • ↓ startupStandardHome/fcp: -47%
  • ↑ startupStandardHome/lcp: +139%
  • ↓ startupStandardHome/cls: -72%
  • ↑ startupStandardHome/load: +12%
  • ↑ startupStandardHome/backgroundConnect: +23%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -50%
  • ↑ startupStandardHome/loadScripts: +10%
  • ↑ startupStandardHome/setupStore: +19%
  • ↑ startupStandardHome/inp: +100%
  • ↑ startupStandardHome/lcp: +14%
User Journey Benchmarks · Samples: 5 · mock API 🔴 1
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 total
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
🔴 total

📈 Results compared to the previous 5 runs on main

  • ↑ onboardingImportWallet/srpButtonToSrpForm: +17%
  • ↑ onboardingImportWallet/confirmSrpToPwForm: +26%
  • ↑ onboardingImportWallet/pwFormToMetricsScreen: +38%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -92%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -74%
  • ↓ onboardingImportWallet/longTaskCount: -100%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -100%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -100%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -85%
  • ↓ onboardingNewWallet/createWalletToSocialScreen: -11%
  • ↓ onboardingNewWallet/agreeButtonToOnboardingSuccess: -32%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -77%
  • ↓ onboardingNewWallet/longTaskCount: -100%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -100%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -100%
  • ↓ onboardingNewWallet/tbt: -100%
  • ↓ onboardingNewWallet/total: -73%
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ dappPageLoad/pageLoadTime: -59%
  • ↓ dappPageLoad/domContentLoaded: -17%
  • ↓ dappPageLoad/firstPaint: -42%
  • ↓ dappPageLoad/firstContentfulPaint: -42%
Bundle Size Diffs
Status Bundle Total Diff Change
✅ background 15.26 MiB 0 Bytes 0.00%
✅ ui 19.42 MiB 0 Bytes 0.00%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.46 MiB 0 Bytes 0.00%
✅ content scripts 3.23 MiB 0 Bytes 0.00%
✅ unzipped 79.77 MiB 0 Bytes 0.00%
✅ zip 23.86 MiB 0 Bytes 0.00%

@LeVinhGithub
LeVinhGithub marked this pull request as ready for review November 9, 2026 13:17
@LeVinhGithub
LeVinhGithub requested a review from a team as a code owner November 9, 2026 13:17
@metamask-ci

metamask-ci Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor
Builds ready [153aeea] [reused from 58e30f8]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 3 warn · 🔴 3 fail)

Baseline (latest main): f693520 | Date: 11/3/2026 | Pipeline: 42624623314 | Baseline logs

Metricschrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 load_new_account(p95) [CI log]🔴 load_new_account(p95) [CI log]
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]

Regressions (🔴 3 failures)

Interaction Benchmarks · Samples: 5 🔴 2
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 [CI log]
🔴 load_new_account
🔴 [CI log]
🔴 load_new_account
confirmTx
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ loadNewAccount/load_new_account: +183%
  • ↑ loadNewAccount/total: +183%
  • ↓ loadNewAccount/inp: -18%
  • ↑ loadNewAccount/lcp: +949%
  • ↑ loadNewAccount/cls: +573%
  • ↑ confirmTx/longTaskCount: +67%
  • ↑ confirmTx/longTaskTotalDuration: +77%
  • ↑ confirmTx/longTaskMaxDuration: +58%
  • ↑ confirmTx/tbt: +88%
  • ↓ confirmTx/inp: -13%
  • ↑ confirmTx/fcp: +11%
  • ↑ confirmTx/lcp: +1020%
  • ↓ confirmTx/cls: -14%
  • ↑ bridgeUserActions/bridge_load_page: +120%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +24%
  • ↑ bridgeUserActions/longTaskCount: +36%
  • ↑ bridgeUserActions/longTaskTotalDuration: +92%
  • ↑ bridgeUserActions/longTaskMaxDuration: +66%
  • ↑ bridgeUserActions/tbt: +182%
  • ↑ bridgeUserActions/total: +14%
  • ↑ bridgeUserActions/lcp: +977%
  • ↑ bridgeUserActions/cls: +621%
  • ↑ loadNewAccount/load_new_account: +185%
  • ↑ loadNewAccount/total: +185%
  • ↓ loadNewAccount/inp: -10%
  • ↓ loadNewAccount/fcp: -30%
  • ↑ loadNewAccount/lcp: +1288%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↓ confirmTx/inp: -21%
  • ↑ confirmTx/fcp: +16%
  • ↑ confirmTx/lcp: +1314%
  • ↑ bridgeUserActions/bridge_load_page: +249%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +87%
  • ↑ bridgeUserActions/bridge_search_token: +24%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +64%
  • ↑ bridgeUserActions/inp: +54%
  • ↓ bridgeUserActions/fcp: -37%
  • ↑ bridgeUserActions/lcp: +1239%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 1.9s
  • 🟡 confirmTx/FCP: p75 1.9s
  • 🟡 bridgeUserActions/FCP: p75 1.9s
  • 🟡 confirmTx/FCP: p75 2.0s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ startupStandardHome/uiStartup: +86%
  • ↑ startupStandardHome/load: +120%
  • ↑ startupStandardHome/domContentLoaded: +121%
  • ↑ startupStandardHome/domInteractive: +18%
  • ↓ startupStandardHome/firstPaint: -55%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -29%
  • ↑ startupStandardHome/loadScripts: +119%
  • ↑ startupStandardHome/setupStore: +101%
  • ↑ startupStandardHome/longTaskCount: +43%
  • ↑ startupStandardHome/longTaskTotalDuration: +118%
  • ↑ startupStandardHome/longTaskMaxDuration: +132%
  • ↑ startupStandardHome/tbt: +141%
  • ↓ startupStandardHome/inp: -11%
  • ↓ startupStandardHome/fcp: -57%
  • ↑ startupStandardHome/lcp: +93%
  • ↓ startupStandardHome/cls: -72%
  • ↓ startupStandardHome/domInteractive: -43%
  • ↑ startupStandardHome/backgroundConnect: +11%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -50%
  • ↓ startupStandardHome/fcp: -36%
User Journey Benchmarks · Samples: 5 · mock API 🔴 1
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
🔴 total
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ onboardingImportWallet/srpButtonToSrpForm: +20%
  • ↑ onboardingImportWallet/confirmSrpToPwForm: +35%
  • ↑ onboardingImportWallet/pwFormToMetricsScreen: +53%
  • ↑ onboardingImportWallet/metricsToWalletReadyScreen: +20%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -92%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -73%
  • ↓ onboardingImportWallet/longTaskCount: -100%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -100%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -100%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -85%
  • ↓ onboardingNewWallet/createWalletToSocialScreen: -11%
  • ↑ onboardingNewWallet/createPwToRecoveryScreen: +25%
  • ↑ onboardingNewWallet/skipBackupToMetricsScreen: +15%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -75%
  • ↓ onboardingNewWallet/longTaskCount: -62%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -74%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -37%
  • ↓ onboardingNewWallet/tbt: -100%
  • ↓ onboardingNewWallet/total: -70%
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ dappPageLoad/pageLoadTime: -66%
  • ↓ dappPageLoad/domContentLoaded: -30%
  • ↓ dappPageLoad/firstPaint: -47%
  • ↓ dappPageLoad/firstContentfulPaint: -47%
Bundle Size Diffs
Status Bundle Total Diff Change
✅ background 15.26 MiB 0 Bytes 0.00%
✅ ui 19.42 MiB 0 Bytes 0.00%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.46 MiB 0 Bytes 0.00%
✅ content scripts 3.23 MiB 0 Bytes 0.00%
✅ unzipped 79.77 MiB 0 Bytes 0.00%
✅ zip 23.86 MiB 0 Bytes 0.00%

@seaona seaona left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🙌

@LeVinhGithub
LeVinhGithub added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit 9ad7909 Nov 9, 2026
111 checks passed
@LeVinhGithub
LeVinhGithub deleted the harry/fix-flaky-malicious-signatures-inline-alert branch November 9, 2026 15:08
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 9, 2026
@metamaskbot metamaskbot added the release-13.58.0 Issue or pull request that will be included in release 13.58.0 label Nov 16, 2026

This branch was previously deployed

1 inactive deployment
pr-comment — 153aeea1 Deployed Nov 9, 2026 by LeVinhGithub via Publish prerelease / Publish prerelease #173480
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.58.0 Issue or pull request that will be included in release 13.58.0 size-XS team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants