From 7fff451d84a63def1e9149676b08c80b9ea0c7af Mon Sep 17 00:00:00 2001 From: AyakorK Date: Mon, 5 Feb 2024 15:45:04 +0100 Subject: [PATCH 1/2] fix: Add headless chrome --- spec/spec_helper.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a4e7913d..e3c91312 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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, + capabilities: [options] + ) +end + RSpec.configure do |config| config.formatter = ENV.fetch("RSPEC_FORMAT", "progress").to_sym config.include EnvironmentVariablesHelper From 0706a9898ab1d785ae1ce54d0a764a4c45138d49 Mon Sep 17 00:00:00 2001 From: AyakorK Date: Mon, 5 Feb 2024 16:31:10 +0100 Subject: [PATCH 2/2] feat: Try to fix options --- spec/spec_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e3c91312..869b2ce5 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -19,7 +19,7 @@ Capybara::Selenium::Driver.new( app, browser: :chrome, - capabilities: [options] + options: options ) end