From f83c48fc0011605688bb75c0f2874d944195bcf0 Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Mon, 18 Oct 2021 15:46:03 +0200 Subject: [PATCH] Update Selenium config for 4.0 compatibility. --- spec/support/capybara/selenium_driver.rb | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/spec/support/capybara/selenium_driver.rb b/spec/support/capybara/selenium_driver.rb index ea016806a..27cec8e10 100644 --- a/spec/support/capybara/selenium_driver.rb +++ b/spec/support/capybara/selenium_driver.rb @@ -7,21 +7,19 @@ Capybara.register_driver(:zammad_chrome) do |app| # Turn on browser logs - capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( - loggingPrefs: { + options = Selenium::WebDriver::Chrome::Options.new( + logging_prefs: { browser: 'ALL' }, - chromeOptions: { - prefs: { - 'intl.accept_languages' => 'en-US', - 'profile.default_content_setting_values.notifications' => 1, # ALLOW notifications - }, + prefs: { + 'intl.accept_languages' => 'en-US', + 'profile.default_content_setting_values.notifications' => 1, # ALLOW notifications }, ) options = { - browser: :chrome, - desired_capabilities: capabilities, + browser: :chrome, + options: options } if ENV['REMOTE_URL'].present? @@ -40,13 +38,9 @@ Capybara.register_driver(:zammad_firefox) do |app| profile['general.useragent.locale'] = 'en-US' profile['permissions.default.desktop-notification'] = 1 # ALLOW notifications - capabilities = Selenium::WebDriver::Remote::Capabilities.firefox( - firefox_profile: profile, - ) - options = { - browser: :firefox, - desired_capabilities: capabilities, + browser: :firefox, + options: Selenium::WebDriver::Firefox::Options.new(profile: profile), } if ENV['REMOTE_URL'].present?