Fix flakey cucumber specs#426
Open
cycomachead wants to merge 1 commit intomainfrom
Open
Conversation
- Increase Capybara.default_max_wait_time to 10s to handle slow JS initialization. - Update headless Chrome flags to use --headless=new and improve CI resource usage. - Replace fragile sleep-based modal closing with direct Bootstrap API calls. - Add polling for TinyMCE initialization to prevent race conditions. - Scope Selectize lookups to specific IDs to avoid ambiguous matches. - Use ensure blocks when toggling Capybara.ignore_hidden_elements to prevent state leakage between scenarios. Co-authored-by: Claude Code <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #426 +/- ##
=======================================
Coverage 74.71% 74.71%
=======================================
Files 29 29
Lines 1135 1135
=======================================
Hits 848 848
Misses 287 287 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pivotal Tracker Link
What this PR does:
This pull request fixes flaky Cucumber/Capybara specs that were intermittently failing in CI due to race conditions between test steps and asynchronous JavaScript initialization.
How should this PR be tested?
Root causes addressed:
Capybara.default_max_wait_timebumped from 2s to 10s to give DataTables, TinyMCE, Selectize, and Bootstrap modals time to initialize under CI load.--headlessto--headless=new; added--no-sandboxand--disable-dev-shm-usagefor better CI resource handling.sleep 0.2+ click sequence with a direct Bootstrap$('#emailModal').modal('hide')API call, eliminating the race between required-field validation and the close button click.tinymce.editors.length > 0before callingsetContent, preventingundefinederrors on async editor initialization.#teacher_languagesby ID rather thanfirst(".selectize-input"), which was matching the school selectize widget on the same form.Capybara.ignore_hidden_elements = falseblocks inbegin/ensureso a failing assertion can't leave the flag flipped and corrupt subsequent scenarios.Are there any complications to deploying this?
No — test-only changes with no impact on application code.
Checklist:
michael/12345-add-new-featureAny branch name will do as long as the story ID is there. You can usegit checkout -b [new-branch-name])Superconductor Ticket Implementation | App Preview | Guided Review