Skip to content

Commit

Permalink
fix: Add headless chrome (#48)
Browse files Browse the repository at this point in the history
* fix: Add headless chrome

* feat: Try to fix options
  • Loading branch information
AyakorK authored Feb 9, 2024
1 parent 49e7d58 commit 2b0e8d7
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 @@ -6,6 +6,23 @@

Dir.glob("./spec/support/**/*.rb").sort.each { |f| require f }

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,
options: options
)
end

RSpec.configure do |config|
config.formatter = ENV.fetch("RSPEC_FORMAT", "progress").to_sym
config.include EnvironmentVariablesHelper
Expand Down

0 comments on commit 2b0e8d7

Please sign in to comment.