Repository navigation
test: fix flaky test Shield entry modal in shield-plan-subscription - #47608
Open
LeVinhGithub wants to merge 1 commit into
Open
LeVinhGithub wants to merge 1 commit into
LeVinhGithub wants to merge 1 commit into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
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. |
Contributor
✨ Files requiring CODEOWNER review ✨🧪 @MetaMask/qa (1 files, +10 -2)
|
Contributor
Builds ready [adbbf32] [reused from 2338170]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 2 warn · 🔴 3 fail)
Bundle Size Diffs
|
Unik0rnMaggie
approved these changes
Nov 4, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Shield subscription E2E tests sometimes click Get started while the Shield entry modal is still sliding up. The click misses, the modal stays open, and the test times out waiting for the Shield plan page.
Flake type: Race Conditions with React Re-renders
Root cause:
Solution:
Slack: https://consensys.slack.com/archives/CTQAGKY5V/p1793775998824649?thread_ts=1793693705.182669&cid=CTQAGKY5V
Changelog
CHANGELOG entry: null
Manual testing steps
yarn start:test.Screenshots/Recordings
Before
CI failure screenshot (
should subscribe to the shield plan from the settings > shield - monthly plan,should subscribe to the shield plan from the settings > shield - annual plan, andshould shield-plan page redirect to settings page when user clicks back button): Shows the Settings page in the background (Preferences,Notifications,Security and privacy,Privacy,Backup and security,Transaction Shield) with the"Introducing Transaction Shield"modal ([data-testid="shield-entry-modal"]) still open on top of Settings. Inside the modal body, the heading, subtitle, and 252px Rive shield illustration fill almost the entire modal height (395px), leaving only a ~2px white sliver of the"Start 14-day free trial"button ([data-testid="shield-entry-modal-get-started-button"]) visible at the very bottom edge because the click fired while the modal and Rive canvas were still animating/mounting and missed the button.After
No product UI change. Get started and Skip wait until the button is clickable and has stopped moving before clicking and waiting for it to disappear, and the navigation tests wait for the Shield plan page to load before clicking Back.
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
E2E page-object and spec timing only; no application or production code changes.
Overview
Fixes flaky Shield subscription E2E failures caused by clicking Get started / Skip while the entry modal is still animating (slide-up + Rive canvas), which left the modal open and timed out waiting for the plan page.
HomePage shield modal actions now wait for the button to be clickable and stationary, then click and wait for the control to disappear—matching patterns used elsewhere in page objects.
Navigation tests in
shield-plan-subscription.spec.tsnow assert the Shield plan page is loaded before Back, so back navigation isn’t fired while the wallet is still transitioning off the modal.Reviewed by Cursor Bugbot for commit adbbf32. Bugbot is set up for automated code reviews on this repo. Configure here.