From: Anton Khorev Date: Fri, 14 Feb 2025 17:09:05 +0000 (+0300) Subject: Add option to override Firefox binary used in system tests X-Git-Tag: live~137^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/b58a70262ec52a8d1ed5701badac75ae9f84afd0?ds=inline Add option to override Firefox binary used in system tests --- diff --git a/config/settings/test.yml b/config/settings/test.yml index b0e2f4613..b7cffcc27 100644 --- a/config/settings/test.yml +++ b/config/settings/test.yml @@ -53,3 +53,5 @@ doorkeeper_signing_key: | cK1+/2V+OkM/0nXjxPwPj7LiOediUyZNUn48r29uGOL1S83PSUdyST207CP6mZjc K8aJmnGsVEAcWPzbpNh14q/c -----END PRIVATE KEY----- +# 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 0ddb8a87a..496f37c16 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -9,6 +9,7 @@ end class ApplicationSystemTestCase < ActionDispatch::SystemTestCase driven_by :selenium, :using => :headless_firefox do |options| options.add_preference("intl.accept_languages", "en") + options.binary = Settings.system_test_firefox_binary if Settings.system_test_firefox_binary end def before_setup diff --git a/test/teaspoon_env.rb b/test/teaspoon_env.rb index 8a9dc001f..c14045b1c 100644 --- a/test/teaspoon_env.rb +++ b/test/teaspoon_env.rb @@ -100,10 +100,12 @@ 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.binary = Settings.system_test_firefox_binary if Settings.system_test_firefox_binary config.driver_options = { :client_driver => :firefox, :selenium_options => { - :options => Selenium::WebDriver::Firefox::Options.new(:args => ["-headless"]) + :options => firefox_options } }