Skip to content

Commit

Permalink
Disable Chrome's search engine selection screen when running system s…
Browse files Browse the repository at this point in the history
…pecs (mastodon#31437)
  • Loading branch information
renchap authored Aug 15, 2024
1 parent 4545b8d commit 5d04e29
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions spec/support/capybara.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@

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,
Expand Down

0 comments on commit 5d04e29

Please sign in to comment.