From 2359ca79bdfce6521418e8cbd1975287bf73353e Mon Sep 17 00:00:00 2001 From: Desiree Chevalier Date: Wed, 29 Mar 2023 14:00:28 -0400 Subject: [PATCH] Add QA browser version env var and updates for grid testing --- qa/qa/runtime/browser.rb | 13 +++++++------ qa/qa/runtime/env.rb | 4 ++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/qa/qa/runtime/browser.rb b/qa/qa/runtime/browser.rb index 945823fb9c0eef..b0e40b45f284bb 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 810912c7ccf87c..8926991bef66e9 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 -- GitLab