From cf7a32bf29a7412a0f4b373ac3045f2555762d03 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 17 May 2023 21:07:21 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- qa/qa/resource/base.rb | 8 +++++--- qa/spec/resource/base_spec.rb | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'qa') 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 -- cgit v1.2.1