Disable Chrome's search engine selection screen when running system specs (#31437)

This commit is contained in:
Renaud Chaput 2024-08-15 08:45:00 +02:00 committed by GitHub
parent 4545b8d6cb
commit 5d04e29775
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,14 +6,20 @@ Capybara.app_host = "http://#{Capybara.server_host}:#{Capybara.server_port}"
require 'selenium/webdriver'
def common_chrome_options
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument '--window-size=1680,1050'
options.add_argument '--disable-search-engine-choice-screen'
options
end
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app, browser: :chrome)
Capybara::Selenium::Driver.new(app, browser: :chrome, options: common_chrome_options)
end
Capybara.register_driver :headless_chrome do |app|
options = Selenium::WebDriver::Chrome::Options.new
options = common_chrome_options
options.add_argument '--headless=new'
options.add_argument '--window-size=1680,1050'
Capybara::Selenium::Driver.new(
app,