Repository navigation
test: fix flaky test snap management - #47435
LeVinhGithub wants to merge 9 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
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. |
✨ Files requiring CODEOWNER review ✨🫰 @MetaMask/core-platform (1 files, +5 -0)
|
Builds ready [dcee04a]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 3 warn · 🔴 3 fail)
Bundle Size Diffs [🚀 Bundle size reduced!]
|
Builds ready [a3c29dc] [reused from dcee04a]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 3 warn · 🔴 3 fail)
Bundle Size Diffs [🚀 Bundle size reduced!]
|
Builds ready [20f2118] [reused from 869b645]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 3 warn · 🔴 3 fail)
Bundle Size Diffs
|
Builds ready [ccaa144] [reused from 0df0258]
⚡ Performance Benchmarks (Total: 🟢 9 pass · 🟡 2 warn · 🔴 2 fail)
Bundle Size Diffs
|
Builds ready [2d13a2b]
⚡ Performance Benchmarks (Total: 🟢 9 pass · 🟡 0 warn · 🔴 4 fail)
Bundle Size Diffs
|
Builds ready [ff932a3] [reused from ded204d]
⚡ Performance Benchmarks (Total: 🟢 5 pass · 🟡 5 warn · 🔴 3 fail)
Bundle Size Diffs
|
Builds ready [8700d70] [reused from e231b08]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 3 warn · 🔴 3 fail)
Bundle Size Diffs
|
Builds ready [e68f1c4] [reused from feb5d41]
⚡ Performance Benchmarks (Total: 🟢 9 pass · 🟡 0 warn · 🔴 4 fail)
Bundle Size Diffs
|
Builds ready [5b67fb0]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 1 warn · 🔴 4 fail)
Bundle Size Diffs
|
|



Description
The snap management test sometimes times out while opening the account menu right after a snap install.
Flake type: Actions that Take Time
Root cause:
Solution:
Slack: https://consensys.slack.com/archives/CTQAGKY5V/p1793175477913009?thread_ts=1793175412.679939&cid=CTQAGKY5V
Changelog
CHANGELOG entry: null
Manual testing steps
yarn start:test.SELENIUM_BROWSER=chrome yarn test:e2e:single test/e2e/snaps/test-snap-management.spec.ts --debug --leave-running.Screenshots/Recordings
Before
MetaMaskfullscreen window): Shows the unlocked MetaMask Home screen (Account 1,25 ETHonLocalhost 8545, token list) with the global menu drawer still closed (<dialog>has noopenattribute, so[data-testid="drawer-close-button"]is not visible) because the click on[data-testid="account-options-menu-button"]happened while the fullscreen window was still redirecting back to Home (#/) from/connect/<id>/snap-install-result.Test Snapsdapp window): Shows theNotifications Snapcard (npm:@metamask/notification-example-snap) with the button text updated toReconnect to Notifications Snap, confirming that the snap installation completed in the background.After
No product UI change. After approving the snap install, the helper waits until
Reconnect to Notifications Snapis displayed in the Test Snaps dapp and the snap is enabled in wallet state, and the test waits for the MetaMask Home screen to finish loading before opening the account menu and snap list.Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
E2e test-only changes with no production code paths affected.
Overview
Fixes flaky snap management e2e by synchronizing on install completion and a settled Home screen instead of clicking the account menu while MetaMask is still loading.
The Notifications snap install step now passes
expectedMessageandsnapIdintoopenTestSnapClickButtonAndInstall, so the test waits for the Test Snaps button to show Reconnect to Notifications Snap and for the snap to be enabled in wallet state before continuing. After switching to the fullscreen extension window, it callshomePage.checkPageIsLoaded()before opening the snap list from the header, avoiding the drawer timeout when Home was still redirecting from the install result route.Reviewed by Cursor Bugbot for commit 5b67fb0. Bugbot is set up for automated code reviews on this repo. Configure here.