Skip to content

Commit

Permalink
configure headless chrome
Browse files Browse the repository at this point in the history
- larger window
- faster exec
  • Loading branch information
jparr committed May 10, 2024
1 parent 3155a7c commit 3ccf15d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@
ActiveRecord::Migration.maintain_test_schema!

Capybara.server = :puma
Capybara.register_driver :selenium_chrome_headless do |app|
# Capybara::Selenium::Driver.load_selenium
browser_options = ::Selenium::WebDriver::Chrome::Options.new.tap do |opts|
opts.args << '--window-size=1920,1080'
opts.args << '--force-device-scale-factor=0.95'
opts.args << '--headless'
opts.args << '--disable-gpu'
opts.args << '--disable-site-isolation-trials'
opts.args << '--no-sandbox'
end
Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options)
end
Capybara.javascript_driver = :selenium_chrome_headless
Capybara.enable_aria_label = true
Capybara.disable_animation = true
Expand Down

0 comments on commit 3ccf15d

Please sign in to comment.