Eager-load the Capybara server to prevent timeouts

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2017-03-30 16:30:05 +02:00
parent e559283cc0
commit f659c406ab
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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 '/'