Commit 15fecbc4 authored by Thong Kuah's avatar Thong Kuah

Add option to use the same Chrome profile

If CHROME_REUSE_PROFILE is enabled, QA will use the same profile
everytime, which will be useful for local QA runs as the browser can
then cache assets, etc.
parent 0e3f6251
...@@ -70,6 +70,13 @@ module QA ...@@ -70,6 +70,13 @@ module QA
options.add_argument("disable-gpu") options.add_argument("disable-gpu")
end end
# Use the same profile on QA runs if CHROME_REUSE_PROFILE is true.
# Useful to speed up local QA.
if QA::Runtime::Env.reuse_chrome_profile?
qa_profile_dir = ::File.expand_path('../../tmp/qa-profile', __dir__)
options.add_argument("user-data-dir=#{qa_profile_dir}")
end
# Disable /dev/shm use in CI. See https://gitlab.com/gitlab-org/gitlab-ee/issues/4252 # Disable /dev/shm use in CI. See https://gitlab.com/gitlab-org/gitlab-ee/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?
......
...@@ -30,6 +30,11 @@ module QA ...@@ -30,6 +30,11 @@ module QA
enabled?(ENV['CHROME_HEADLESS']) enabled?(ENV['CHROME_HEADLESS'])
end end
# set to 'true' to have Chrome use a fixed profile directory
def reuse_chrome_profile?
enabled?(ENV['CHROME_REUSE_PROFILE'], default: false)
end
def accept_insecure_certs? def accept_insecure_certs?
enabled?(ENV['ACCEPT_INSECURE_CERTS']) enabled?(ENV['ACCEPT_INSECURE_CERTS'])
end end
......
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