summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-17 21:07:21 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-17 21:07:21 +0000
commitcf7a32bf29a7412a0f4b373ac3045f2555762d03 (patch)
tree1630edf014bf7101b63864b63a3c95befedc2100 /qa
parent8746f6e79d7717a8cb16737fecdb977feaa22cdb (diff)
downloadgitlab-ce-cf7a32bf29a7412a0f4b373ac3045f2555762d03.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/resource/base.rb8
-rw-r--r--qa/spec/resource/base_spec.rb17
2 files changed, 20 insertions, 5 deletions
diff --git a/qa/qa/resource/base.rb b/qa/qa/resource/base.rb
index 6c03f45bdfd..c05997d0405 100644
--- a/qa/qa/resource/base.rb
+++ b/qa/qa/resource/base.rb
@@ -182,11 +182,12 @@ module QA
raise NotImplementedError
end
- def visit!(skip_resp_code_check: false)
+ def visit!(skip_finished_loading_check: false, skip_resp_code_check: false)
Runtime::Logger.info("Visiting #{Rainbow(self.class.name).black.bg(:white)} at #{web_url}")
# Just in case an async action is not yet complete
- Support::WaitForRequests.wait_for_requests(skip_resp_code_check: skip_resp_code_check)
+ Support::WaitForRequests.wait_for_requests(skip_finished_loading_check: skip_finished_loading_check,
+ skip_resp_code_check: skip_resp_code_check)
Support::Retrier.retry_until do
visit(web_url)
@@ -194,7 +195,8 @@ module QA
end
# Wait until the new page is ready for us to interact with it
- Support::WaitForRequests.wait_for_requests(skip_resp_code_check: skip_resp_code_check)
+ Support::WaitForRequests.wait_for_requests(skip_finished_loading_check: skip_finished_loading_check,
+ skip_resp_code_check: skip_resp_code_check)
end
def populate(*attribute_names)
diff --git a/qa/spec/resource/base_spec.rb b/qa/spec/resource/base_spec.rb
index e0bfccf5e78..d7e16c1f84b 100644
--- a/qa/spec/resource/base_spec.rb
+++ b/qa/spec/resource/base_spec.rb
@@ -362,7 +362,8 @@ RSpec.describe QA::Resource::Base do
it 'calls #visit with the underlying #web_url' do
allow(resource).to receive(:current_url).and_return(subject.current_url)
- expect(wait_for_requests_class).to receive(:wait_for_requests).with({ skip_resp_code_check: false }).twice
+ expect(wait_for_requests_class).to receive(:wait_for_requests).with({ skip_finished_loading_check: false,
+ skip_resp_code_check: false }).twice
resource.web_url = subject.current_url
resource.visit!
@@ -372,12 +373,24 @@ RSpec.describe QA::Resource::Base do
it 'calls #visit with the underlying #web_url with skip_resp_code_check specified as true' do
allow(resource).to receive(:current_url).and_return(subject.current_url)
- expect(wait_for_requests_class).to receive(:wait_for_requests).with({ skip_resp_code_check: true }).twice
+ expect(wait_for_requests_class).to receive(:wait_for_requests).with({ skip_finished_loading_check: false,
+ skip_resp_code_check: true }).twice
resource.web_url = subject.current_url
resource.visit!(skip_resp_code_check: true)
expect(resource).to have_received(:visit).with(subject.current_url)
end
+
+ it 'calls #visit with the underlying #web_url with skip_finished_loading_check specified as true' do
+ allow(resource).to receive(:current_url).and_return(subject.current_url)
+ expect(wait_for_requests_class).to receive(:wait_for_requests).with({ skip_finished_loading_check: true,
+ skip_resp_code_check: false }).twice
+
+ resource.web_url = subject.current_url
+ resource.visit!(skip_finished_loading_check: true)
+
+ expect(resource).to have_received(:visit).with(subject.current_url)
+ end
end
end