mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-29 21:17:17 +00:00
Reduce Capybara wait time during development
In test-driven development, you run tests and expect them to fail. Waiting for the results unnecessarily long just slows down development. And even though CI can be slow, we should aim for good performance of our code. Long wait times can hide performance bottle necks. If anyone struggles with the default value, we can add an environment variable to adjust the wait time to your machine in .env.test.local. But this may just work for everyone.
This commit is contained in:
@@ -4,10 +4,9 @@
|
||||
# This allows us to find <input aria-label="Name"> with `expect(page).to have_field "Name"`
|
||||
Capybara.enable_aria_label = true
|
||||
|
||||
# Usually, especially when using Selenium, developers tend to increase the max wait time.
|
||||
# With Cuprite, there is no need for that.
|
||||
# We use a Capybara default value here explicitly.
|
||||
Capybara.default_max_wait_time = 10
|
||||
# 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"]
|
||||
|
||||
# Normalize whitespaces when using `has_text?` and similar matchers,
|
||||
# i.e., ignore newlines, trailing spaces, etc.
|
||||
|
||||
Reference in New Issue
Block a user