Skip to content

Commit

Permalink
test: Fix Capybara headless_chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentinchampenois committed May 27, 2024
1 parent 893f3e9 commit e416532
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,20 @@
require "./spec/support/custom_matchers"

SimpleCov.start if ENV["SIMPLECOV"]

Capybara.register_driver :headless_chrome do |app|
options = ::Selenium::WebDriver::Chrome::Options.new
options.args << "--headless=new"
options.args << "--no-sandbox"
options.args << if ENV["BIG_SCREEN_SIZE"].present?
"--window-size=1920,3000"
else
"--window-size=1920,1080"
end
options.args << "--ignore-certificate-errors" if ENV["TEST_SSL"]
Capybara::Selenium::Driver.new(
app,
browser: :chrome,
capabilities: [options]
)
end

0 comments on commit e416532

Please sign in to comment.