Repository navigation
test: fix flaky test Test Snap Homepage tests snap home page functionality - #46503
Conversation
|
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/qa (1 files, +6 -1)
|
Builds ready [1368848]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 3 warn · 🔴 2 fail)
Bundle size diffs
|
|
Test was still failing after the first change (CI logs, so added update to |
Builds ready [ee806df] [reused from 1368848]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 3 warn · 🔴 2 fail)
Bundle size diffs
|
Builds ready [9fe3167]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 5 warn · 🔴 2 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
seaona
left a comment
There was a problem hiding this comment.
good as tmp fix, let's see if we can follow-up with https://consensyssoftware.atlassian.net/browse/MMQA-2441 and find the condition which causes sometimes the click to take no effect, and wait for that instead of retry



Description
After snap installation, the test immediately switched to MetaMask and opened the global-menu drawer.
At that exact moment, the AccountActivity WebSocket connected and fired a state update that closed the drawer.
clickElementfound the "Snaps" option in the DOM (still inside the closed drawer) but timed out waiting for it to become visible.CI logs
Added
testSnaps.checkInstallationComplete()between the snap install and the switch to MetaMask.This holds the test on the TestSnaps page long enough for the AccountActivity WebSocket to connect and settle before the drawer is opened. The same pattern is used in
test-snap-update-component.spec.ts.Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
E2e page-object timing/retry logic only; no production or security impact.
Overview
Makes global menu opening in e2e tests more reliable by changing how the test confirms the drawer actually opened.
In
HeaderNavbar.openGlobalMenu(), the post-click waitwaitForElementToStopMoving(drawerBackButton)is replaced with a visibility check on the drawer close button viafindVisibleElement. If the back button never becomes visible (e.g. the menu click didn’t open the drawer or it closed immediately from a UI update), the flow retries opening the menu withclickElementUsingMouseMoveand checks visibility again.This targets flaky Snap homepage (and similar) flows where the test could proceed while the global menu drawer wasn’t reliably open.
Reviewed by Cursor Bugbot for commit 9fe3167. Bugbot is set up for automated code reviews on this repo. Configure here.