Commit 037dd58e authored by Tanya Pazitny's avatar Tanya Pazitny

Merge branch 'ml-qa-retry-visit' into 'master'

Retry visiting URL if not successful

Closes #35707

See merge request gitlab-org/gitlab!19732
parents cfed1f7c 19af8158
......@@ -64,7 +64,13 @@ module QA
end
def visit!
visit(web_url)
Runtime::Logger.debug("Visiting #{web_url}")
Support::Retrier.retry_until do
visit(web_url)
wait { current_url == web_url }
end
end
def populate(*attributes)
......@@ -72,7 +78,9 @@ module QA
end
def wait(max: 60, interval: 0.1)
QA::Support::Waiter.wait(max: max, interval: interval)
QA::Support::Waiter.wait(max: max, interval: interval) do
yield
end
end
private
......
......@@ -269,6 +269,8 @@ describe QA::Resource::Base do
end
it 'calls #visit with the underlying #web_url' do
allow(resource).to receive(:current_url).and_return(subject.current_url)
resource.web_url = subject.current_url
resource.visit!
......
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