From d54e73e19d93917083232e456f9a05d75291d1ec Mon Sep 17 00:00:00 2001 From: quentinchampenois <26109239+Quentinchampenois@users.noreply.github.com> Date: Wed, 6 Mar 2024 12:30:57 +0100 Subject: [PATCH] fix: Spec helper --- spec/spec_helper.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ff6cc2e..9a13a8e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -15,3 +15,20 @@ Decidim::Dev.dummy_app_path = File.expand_path(File.join(__dir__, "decidim_dummy_app")) require "decidim/dev/test/base_spec_helper" + +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 \ No newline at end of file