From 8ea801e0f5f57e7fef8273b763ca9f1c293f4a11 Mon Sep 17 00:00:00 2001 From: Pablo Brasero Date: Wed, 24 Sep 2025 09:44:11 +0100 Subject: [PATCH] Fix system tests config, broken by devcontainer generator --- test/application_system_test_case.rb | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index e6f186462..d803e4368 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -14,18 +14,26 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase Capybara.configure do |config| config.enable_aria_label = true end + if ENV["CAPYBARA_SERVER_PORT"] - served_by host: "rails-app", port: ENV["CAPYBARA_SERVER_PORT"] + served_by :host => "rails-app", :port => ENV["CAPYBARA_SERVER_PORT"] - driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ], options: { - browser: :remote, - url: "http://#{ENV["SELENIUM_HOST"]}:4444" - } + driven_by( + :selenium, + :using => Settings.system_test_headless ? :headless_firefox : :firefox, + :options => { + :url => "http://#{ENV.fetch('SELENIUM_HOST', nil)}:4444", + :browser => :remote + } + ) do |options| + options.add_preference("intl.accept_languages", "en") + options.binary = Settings.system_test_firefox_binary if Settings.system_test_firefox_binary + end else - driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ] - end - options.add_preference("intl.accept_languages", "en") - options.binary = Settings.system_test_firefox_binary if Settings.system_test_firefox_binary + driven_by :selenium, :using => Settings.system_test_headless ? :headless_firefox : :firefox do |options| + options.add_preference("intl.accept_languages", "en") + options.binary = Settings.system_test_firefox_binary if Settings.system_test_firefox_binary + end end def before_setup -- 2.39.5