From: Tom Hughes Date: Sun, 16 Feb 2025 08:34:14 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/5684' X-Git-Tag: live~273 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/ca6570513c1e6ec649e12cc3c06605b64687f091?hp=90e787eed845a850eab63a22831c9cfa47f4dd3d Merge remote-tracking branch 'upstream/pull/5684' --- diff --git a/config/settings/test.yml b/config/settings/test.yml index b7cffcc27..3cf8c2836 100644 --- a/config/settings/test.yml +++ b/config/settings/test.yml @@ -53,5 +53,7 @@ doorkeeper_signing_key: | cK1+/2V+OkM/0nXjxPwPj7LiOediUyZNUn48r29uGOL1S83PSUdyST207CP6mZjc K8aJmnGsVEAcWPzbpNh14q/c -----END PRIVATE KEY----- +# Run system tests using headless Firefox +system_test_headless: true # Override Firefox binary used in system tests #system_test_firefox_binary: diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index 852f270b6..f2fcadfd7 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -7,7 +7,7 @@ ActiveSupport.on_load(:action_dispatch_system_test_case) do end class ApplicationSystemTestCase < ActionDispatch::SystemTestCase - driven_by :selenium, :using => :headless_firefox do |options| + 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 diff --git a/test/teaspoon_env.rb b/test/teaspoon_env.rb index c14045b1c..a64274c0a 100644 --- a/test/teaspoon_env.rb +++ b/test/teaspoon_env.rb @@ -100,7 +100,8 @@ Teaspoon.configure do |config| # Capybara Webkit: https://github.com/jejacks0n/teaspoon/wiki/Using-Capybara-Webkit require "selenium-webdriver" config.driver = :selenium - firefox_options = Selenium::WebDriver::Firefox::Options.new(:args => ["-headless"]) + firefox_options = Selenium::WebDriver::Firefox::Options.new + firefox_options.args = ["-headless"] if Settings.system_test_headless firefox_options.binary = Settings.system_test_firefox_binary if Settings.system_test_firefox_binary config.driver_options = { :client_driver => :firefox,