diff --git a/qa/qa/runtime/browser.rb b/qa/qa/runtime/browser.rb index 945823fb9c0eef2fbc1483090430eebaecf9dfcf..b0e40b45f284bbb2db81e87e232b11f61c4f40e9 100644 --- a/qa/qa/runtime/browser.rb +++ b/qa/qa/runtime/browser.rb @@ -96,11 +96,12 @@ def self.configure! capabilities['goog:chromeOptions'][:args] << 'disable-dev-shm-usage' if QA::Runtime::Env.disable_dev_shm? # Set chrome default download path - - capabilities['goog:chromeOptions'][:prefs] = { - 'download.default_directory' => File.expand_path(QA::Runtime::Env.chrome_default_download_path), - 'download.prompt_for_download' => false - } + unless QA::Runtime::Env.remote_grid + capabilities['goog:chromeOptions'][:prefs] = { + 'download.default_directory' => File.expand_path(QA::Runtime::Env.chrome_default_download_path), + 'download.prompt_for_download' => false + } + end # Specify the user-agent to allow challenges to be bypassed # See https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/11938 @@ -174,7 +175,7 @@ def self.configure! if QA::Runtime::Env.remote_grid selenium_options[:browser] = :remote selenium_options[:url] = QA::Runtime::Env.remote_grid - capabilities[:browserVersion] = 'latest' + capabilities[:browserVersion] = QA::Runtime::Env.browser_version capabilities['sauce:options'] = { tunnelIdentifier: QA::Runtime::Env.remote_tunnel_id } end diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb index 810912c7ccf87cb52a989adf515b235a5d9db788..8926991bef66e94330c22bf7883dda2f024138f0 100644 --- a/qa/qa/runtime/env.rb +++ b/qa/qa/runtime/env.rb @@ -187,6 +187,10 @@ def browser ENV['QA_BROWSER'].nil? ? :chrome : ENV['QA_BROWSER'].to_sym end + def browser_version + ENV['QA_BROWSER_VERSION'] || 'latest' + end + def remote_mobile_device_name ENV['QA_REMOTE_MOBILE_DEVICE_NAME'] end