From 7d80033c8e9ebd41ecc971590820be15de59329d Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 24 Jun 2025 11:57:38 +1000 Subject: [PATCH] Increase default timeout in system specs --- .env.test | 8 ++++++++ spec/system/support/capybara_setup.rb | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.env.test b/.env.test index 1fa63c9339..0833c82074 100644 --- a/.env.test +++ b/.env.test @@ -1,6 +1,14 @@ # ENV vars for the test environment # Override locally with `.env.test.local` +# Test env specific variables +# +# Adjust this to your computer. When you start test-driven development, you may +# want to reduce this value to avoid waiting for a test that you expect to fail. +CAPYBARA_MAX_WAIT_TIME="10" + +# General app specific variables + # Locale for translation. Using a locale other than `en` tests the # successful fallback to `en`. LOCALE="en_TST" diff --git a/spec/system/support/capybara_setup.rb b/spec/system/support/capybara_setup.rb index 075826951b..87bff0d66e 100644 --- a/spec/system/support/capybara_setup.rb +++ b/spec/system/support/capybara_setup.rb @@ -5,8 +5,9 @@ Capybara.enable_aria_label = true # The default wait time is 2 seconds. Small is good for test-driven development -# ensuring efficient code but CI can be a bit slow. We want to avoid flakiness. -Capybara.default_max_wait_time = 10 if ENV["CI"] +# ensuring efficient code but some machines can be a bit slow. +# And we want to avoid flakiness. +Capybara.default_max_wait_time = ENV.fetch("CAPYBARA_MAX_WAIT_TIME").to_i # Normalize whitespaces when using `has_text?` and similar matchers, # i.e., ignore newlines, trailing spaces, etc.