refactor(e2e): Replace arbitrary waits with state-based waiting in flag tests#6828
Closed
talissoncosta wants to merge 2 commits intomainfrom
Closed
refactor(e2e): Replace arbitrary waits with state-based waiting in flag tests#6828talissoncosta wants to merge 2 commits intomainfrom
talissoncosta wants to merge 2 commits intomainfrom
Conversation
Scan the frontend codebase for design token misuse, dark mode gaps, and component fragmentation. Produces a structured report with 85 findings across 7 areas (colours, typography, spacing, buttons, forms, icons, notifications) and a component inventory covering 11 categories. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ag tests
Replace fixed 500ms timeouts with `waitForElementVisible('#try-it-results')`
to wait for the actual loading state to complete. This approach:
- Eliminates race conditions on slow CI runners
- Runs faster when API responds quickly (no artificial 500ms delays)
- More semantically correct (waits for the element we actually need)
- Consistent with E2E best practices already used elsewhere
The #try-it-results element only receives its ID when the TryIt component
finishes loading (isLoading: false), making it the perfect indicator to
wait for rather than guessing arbitrary timeout values.
Related: #6827 (increased timeouts from 500ms to 2000ms/1500ms)
This PR provides a better alternative to arbitrary timeout increases.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Docker builds report
|
Contributor
Author
|
Closing in favour of clean branch without extra files |
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.
Summary
Improves the E2E test reliability and speed by replacing arbitrary timeout waits with proper state-based waiting.
Changes
Replace fixed
t.wait(500)timeouts withwaitForElementVisible('#try-it-results')in three locations within flag-tests.ts.Why This is Better
Current approach (PR #6827):
t.wait(500)→t.wait(2000)andt.wait(1500)This approach:
#try-it-resultselement to appear (only exists when loading completes)LONG_TIMEOUTof 40s)Technical Details
The
TryItcomponent only assigns the#try-it-resultsID when!this.state.isLoading(TryIt.js:82). This makes it the perfect indicator that:Test Plan
make testRelated Issues