Skip to content

Commit

Permalink
Customize selenium driver to use headless=new
Browse files Browse the repository at this point in the history
  • Loading branch information
ahangarha committed Jan 7, 2024
1 parent 97ea030 commit 5cf4bde
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion spec/dummy/spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@
config.include Capybara::DSL
#
# selenium_firefox webdriver only works for Travis-CI builds.
default_driver = :selenium_chrome_headless
# default_driver = :selenium_chrome_headless
Capybara.register_driver :selenium_chrome_headless do |app|
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--headless=new')

Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
end

supported_drivers = %i[selenium_chrome_headless selenium_chrome selenium selenium_headless]
driver = ENV["DRIVER"].try(:to_sym).presence || default_driver
Expand Down

0 comments on commit 5cf4bde

Please sign in to comment.