diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index 4c5550c40..56e33b68b 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -22,6 +22,12 @@ driven_by(:selenium, using: ENV.fetch("CAPYBARA_DRIVER", "headless_chrome").to_sym, screen_size: [1920, 1080]) do |capabilities| capabilities.add_argument("--no-sandbox") if ENV["CAPYBARA_NO_SANDBOX"].present? + + # Until this is released: + # https://github.com/SeleniumHQ/selenium/pull/13271 + # Use the recommended workaround: + # https://github.com/SeleniumHQ/selenium/pull/13271#issuecomment-1854042830 + capabilities.add_argument("--headless=new") if capabilities.args.delete("--headless") end end end