diff --git a/Gemfile b/Gemfile index 29b5c18..78d44a0 100644 --- a/Gemfile +++ b/Gemfile @@ -58,12 +58,13 @@ end group :test do gem 'capybara' + gem 'capybara-selenium' gem 'database_cleaner' gem 'factory_bot' gem 'launchy' gem 'rspec-collection_matchers' gem 'rspec-rails' - gem 'selenium-webdriver', require: false + gem 'selenium-webdriver', '~> 4.1', require: false gem 'simplecov', require: false gem 'timecop' end diff --git a/Gemfile.lock b/Gemfile.lock index 1dee97c..36a6593 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -86,6 +86,9 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) + capybara-selenium (0.0.6) + capybara + selenium-webdriver childprocess (5.0.0) coderay (1.1.3) concurrent-ruby (1.3.3) @@ -310,6 +313,7 @@ PLATFORMS DEPENDENCIES bootstrap-sass (= 3.4.1) capybara + capybara-selenium database_cleaner exception_notification factory_bot @@ -332,7 +336,7 @@ DEPENDENCIES rubocop-rspec sass-rails (~> 6.0) sdoc (~> 2.4.0) - selenium-webdriver + selenium-webdriver (~> 4.1) simplecov spring timecop diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0ca7e64..4502b0e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -25,26 +25,16 @@ require 'selenium/webdriver' Capybara.register_driver :chrome do |app| - client = Selenium::WebDriver::Remote::Http::Default.new - client.read_timeout = 120 # Set the read timeout to 120 seconds - - Capybara::Selenium::Driver.new(app, browser: :chrome, http_client: client) + Capybara::Selenium::Driver.new(app, browser: :chrome) end Capybara.register_driver :headless_chrome do |app| options = Selenium::WebDriver::Chrome::Options.new - options.add_argument('--headless=old') options.add_argument('--disable_gpu') - # options.add_argument('--disable-popup-blocking') options.add_argument('--window-size=1600,3200') options.add_argument('--disable-search-engine-choice-screen') - - client = Selenium::WebDriver::Remote::Http::Default.new - client.open_timeout = 120 - client.read_timeout = 120 - - Capybara::Selenium::Driver.new(app, browser: :chrome, options:, http_client: client) + Capybara::Selenium::Driver.new(app, browser: :chrome, options:) end Capybara.javascript_driver = :headless_chrome