Increase Capybara default max wait time#315
Merged
Merged
Conversation
The e2e tests run against real environments over the network, usually straight after a deployment when the apps are at their slowest. Capybara's 2 second default gave page loads, redirects and the One Login OAuth handshake too little time to settle, causing intermittent ElementNotFound and current_path failures in the pipeline.
lfdebrux
approved these changes
Jul 24, 2026
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.
What
Sets
Capybara.default_max_wait_timeto 10 seconds. It was never configured, so every finder and matcher only retried for Capybara's 2 second default.Why
The end-to-end tests have been failing intermittently in the deploy pipelines with
ElementNotFound: Unable to find visible css "h1",StaleElementReferenceError, and the One Login redirect assertion catching the browser still on/continue-to-login.These tests drive real environments over the network, immediately after a deployment when the apps are at their slowest, so could take longer than 2 seconds.
One trade-off: negative predicates (e.g. the
has_link?check indelete_form) now wait the full timeout before returning false, so a green run will be slightly slower.