Commit dc7272cc authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'qa-ml-dry-retry-on-exception-ee' into 'master'

[EE] use `retry_on_exception` instead of duplicating code

See merge request gitlab-org/gitlab-ee!14051
parents 8538183a 291c06dc
......@@ -10,19 +10,10 @@ module QA
end
def perform_before_hooks
begin
retries ||= 0
# The login page could take some time to load the first time it is visited.
# We visit the login page and wait for it to properly load only once before the tests.
# The login page could take some time to load the first time it is visited.
# We visit the login page and wait for it to properly load only once before the tests.
QA::Support::Retrier.retry_on_exception do
QA::Runtime::Browser.visit(:gitlab, QA::Page::Main::Login)
rescue QA::Page::Validatable::PageValidationError
if (retries += 1) < 3
QA::Runtime::Logger.warn("The login page did not appear as expected. Retrying... (attempt ##{retries})")
retry
end
raise
end
return unless ENV['EE_LICENSE']
......
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