Repository navigation
test: add checkInstallationComplete into snap install flow and add state readiness check - #46863
Conversation
…ate readiness check
|
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. |
hjetpoluru
left a comment
There was a problem hiding this comment.
Changes LGTM. The failure appears to be related to the AWS downtime, so I’m approving the PR but the tests needs to be rerun again
✨ Files requiring CODEOWNER review ✨🫰 @MetaMask/core-platform (28 files, +71 -160)
🧪 @MetaMask/qa (2 files, +34 -8)
|
Builds ready [3191544]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 2 warn · 🔴 3 fail)
Bundle Size Diffs
|
|
| } | ||
|
|
||
| const localUrl = `http://localhost:${port}${localPath}${url.search}`; | ||
| const localUrl = `http://127.0.0.1:${port}${localPath}${url.search}`; |
There was a problem hiding this comment.
Yes. On macOS localhost can resolve to ::1 (IPv6) but the test dapp server only binds to 127.0.0.1 (IPv4), causing connection failures locally.
No impact on CI since Linux always maps localhost to 127.0.0.1.



Description
Refactors the snap E2E test install flow to streamline the specs and fix a race-condition-driven flakiness.
openTestSnapClickButtonAndInstallabsorbscheckInstallationComplete: 25 spec files previously called the flow and then separately calledtestSnaps.checkInstallationComplete()right after.Now they pass
expectedMessageas an option and the flow handles it internally.Deterministic snap-ready state check: after install, the flow can now poll MetaMask's Redux state via
getCleanAppStateto confirm the snap is enabled and no longer in installing status before returning. This ensures the background has fully committed the snap install before the test continues.Removed temporary retry from
openGlobalMenu: PR #46503 added a retry block toheader-navbar.tsas a temporary fix for a flaky homepage snap test.Fixed
localhostto127.0.0.1intest-snap-dialogandtest-snap-networkaccess: both tests were failing locally because the dapp page failed to open when using localhost.Changelog
CHANGELOG entry: null
Related issues
Fixes: MMQA-2441
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Changes are limited to E2E test helpers, mocks, and specs with no production wallet or security logic touched.
Overview
Refactors Snap E2E install helpers to centralize post-install waits and cut race-driven flakiness.
openTestSnapClickButtonAndInstallnow acceptsexpectedMessage(runs the former per-speccheckInstallationCompleteon the connect button) and optionalsnapId(polls MetaMask Redux viagetCleanAppStateuntil the snap is enabled and notinstalling). Dozens of snap specs pass these options instead of duplicating install-complete checks.Other test fixes: the test-snaps site mock proxies fetches to
127.0.0.1instead oflocalhost;openGlobalMenudrops a temporary double-click retry now that install timing is handled in the flow; dialog spec drops a redundant localhost URL override.Reviewed by Cursor Bugbot for commit 3191544. Bugbot is set up for automated code reviews on this repo. Configure here.