diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index be1378ffac..4357d51382 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -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,