Tell Capybara to disable animations to try to increase test reliability #2814
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.
Some of the OHMS table of contents stuff especially, combined with search, involves a lot of opening/closing/moving things. Advancing to next search result may involve automatic switching of tabs and opening of a collaped ToC section. One particular text also involves opening up the "share link" section collapse.
The share link/copy to clipboard test in particular has been really flakey -- mostly on Github hard to reproduce locally.
Some googling suggested that perhaps any animations including scrolling animations can be especially unexpectedly slow on an ARM cpu (which perhaps Github Actions uses), or that in general setting
Capybara.disable_animations
could help with flakey specs where animations are involved.Which could apply to our current flakey modal test as well.
I think
Capybara.disable_animations
may set browser-settings "reduce motion" settings.A test seems to reveal it is helping with our flakey specs, re-running tests here hard to reproduce failures that were easy to reproduce before. Worth a shot.
Here is the current most fail-y test, and it's somewhat mysterious why -- screenshots reveal that the "copy to clipboard" button was underneath the fixed header, instead of properly scrolled to be visible. But unclear why and hard to reproduce locally, and putting in explicit commands to scroll window to have button at bottom didn't help. Maybe the scroll was animated and much too slow?