mirror of https://github.com/tootsuite/mastodon
Disable Chrome's search engine selection screen when running system specs (#31437)
parent
4545b8d6cb
commit
5d04e29775
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue