Eager-load the Capybara server to prevent timeouts
Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
parent
e559283cc0
commit
f659c406ab
|
@ -25,5 +25,5 @@ Capybara.ignore_hidden_elements = false
|
||||||
Capybara::Screenshot.prune_strategy = :keep_last_run
|
Capybara::Screenshot.prune_strategy = :keep_last_run
|
||||||
|
|
||||||
Spinach.hooks.before_run do
|
Spinach.hooks.before_run do
|
||||||
TestEnv.warm_asset_cache unless ENV['CI'] || ENV['CI_SERVER']
|
TestEnv.eager_load_driver_server
|
||||||
end
|
end
|
||||||
|
|
|
@ -27,6 +27,6 @@ Capybara::Screenshot.prune_strategy = :keep_last_run
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
config.before(:suite) do
|
config.before(:suite) do
|
||||||
TestEnv.warm_asset_cache unless ENV['CI'] || ENV['CI_SERVER']
|
TestEnv.eager_load_driver_server
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -169,7 +169,7 @@ module TestEnv
|
||||||
#
|
#
|
||||||
# Otherwise they'd be created by the first test, often timing out and
|
# Otherwise they'd be created by the first test, often timing out and
|
||||||
# causing a transient test failure
|
# causing a transient test failure
|
||||||
def warm_asset_cache
|
def eager_load_driver_server
|
||||||
return unless defined?(Capybara)
|
return unless defined?(Capybara)
|
||||||
|
|
||||||
Capybara.current_session.driver.visit '/'
|
Capybara.current_session.driver.visit '/'
|
||||||
|
|
Loading…
Reference in New Issue