Fix flaky spec: Admin budgets Manage groups and headings Create group #2696
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.
References
Objectives
spec/features/admin/budgets_spec.rb:237
: "Admin budgets Manage groups and headings Create group"Explain why the test is flaky, or under which conditions/scenario it fails randomly
To show the form, the JavaScript function
App.Forms.toggleLink()
calls jQuery'stoggle
, which animates the way the form appears on the screen.Sometimes Capybara clicks the button while it's still moving, resulting in no request being sent to the server.
Explain why your PR fixes it
By disabling CSS and jQuery animations in the test environment, the button shows up immediately at the right position, and Capybara always clicks it correctly.
Notes
spec/features/admin/homepage/homepage_spec.rb:43
("Homepage Feeds Debates"), which fails on my machine sometimes with the message:Capybara::ModalNotFound: Unable to find modal dialog (...) Selenium::WebDriver::Error::TimeOutError: timed out after 2 seconds.
Related links