Skip to content

Increase Capybara default max wait time#315

Merged
theseanything merged 1 commit into
mainfrom
increase-capybara-wait-time
Jul 24, 2026
Merged

Increase Capybara default max wait time#315
theseanything merged 1 commit into
mainfrom
increase-capybara-wait-time

Conversation

@theseanything

@theseanything theseanything commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What

Sets Capybara.default_max_wait_time to 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 in delete_form) now wait the full timeout before returning false, so a green run will be slightly slower.

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.
@theseanything
theseanything added this pull request to the merge queue Jul 24, 2026
Merged via the queue into main with commit 480f4fd Jul 24, 2026
4 checks passed
@theseanything
theseanything deleted the increase-capybara-wait-time branch July 24, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants