From 70c9544b268ed8a5222250202c57b38243f93542 Mon Sep 17 00:00:00 2001 From: Daria Mayorova Date: Mon, 25 Nov 2024 23:27:41 +0100 Subject: [PATCH] Remove redundant configs for Capybara --- features/support/capybara.rb | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/features/support/capybara.rb b/features/support/capybara.rb index 69592a80a2..c0b9665b47 100644 --- a/features/support/capybara.rb +++ b/features/support/capybara.rb @@ -13,37 +13,17 @@ # in case firefox is needed! # DEFAULT_JS_DRIVER = :headless_firefox -Capybara.default_driver = :rack_test -Capybara.javascript_driver = DEFAULT_JS_DRIVER -Capybara.default_selector = :css -Capybara.disable_animation = true - -# Capybara 3 changes the default server to Puma. It can be reverted to the previous default of WEBRick by specifying: -Capybara.server = :webrick - -# see http://www.elabs.se/blog/60-introducing-capybara-2-1 Capybara.configure do |config| config.default_driver = :rack_test config.javascript_driver = DEFAULT_JS_DRIVER + config.default_selector = :css config.raise_server_errors = true config.match = :prefer_exact config.always_include_port = true config.default_max_wait_time = 10 -end - -# Needed because cucumber-rails requires capybara/cucumber -# https://github.com/cucumber/cucumber-rails/blob/7b47bf1dda3368247bf2d45bcb17a224e80ec6fd/lib/cucumber/rails/capybara.rb#L3 -# https://github.com/teamcapybara/capybara/blob/2.18.0/lib/capybara/cucumber.rb#L17-L19 -Before '@javascript' do - Capybara.current_driver = DEFAULT_JS_DRIVER -end - -Before '@chrome' do - Capybara.current_driver = :chrome -end - -Before '@firefox' do - Capybara.current_driver = :firefox + # Capybara 3 changes the default server to Puma. It can be reverted to the previous default of WEBRick by specifying: + config.server = :webrick + config.disable_animation = true end Around '@security' do |scenario, block|