Commit e2347ec9 authored by Mark Lapierre's avatar Mark Lapierre

Allow user-agent to be set in QA tests

Can be set via the `GITLAB_QA_USER_AGENT` environment variable.

The default Chrome user-agent will be used if the environment variable
is not set.
parent 9b014791
...@@ -98,6 +98,10 @@ module QA ...@@ -98,6 +98,10 @@ module QA
# Disable /dev/shm use in CI. See https://gitlab.com/gitlab-org/gitlab/issues/4252 # Disable /dev/shm use in CI. See https://gitlab.com/gitlab-org/gitlab/issues/4252
options.add_argument("disable-dev-shm-usage") if QA::Runtime::Env.running_in_ci? options.add_argument("disable-dev-shm-usage") if QA::Runtime::Env.running_in_ci?
# Specify the user-agent to allow challenges to be bypassed
# See https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/11938
options.add_argument("user-agent=#{QA::Runtime::Env.user_agent}") if QA::Runtime::Env.user_agent
end end
# Use the same profile on QA runs if CHROME_REUSE_PROFILE is true. # Use the same profile on QA runs if CHROME_REUSE_PROFILE is true.
......
...@@ -395,6 +395,10 @@ module QA ...@@ -395,6 +395,10 @@ module QA
ENV['DEPLOY_VERSION'] ENV['DEPLOY_VERSION']
end end
def user_agent
ENV['GITLAB_QA_USER_AGENT']
end
private private
def remote_grid_credentials def remote_grid_credentials
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment