summaryrefslogtreecommitdiff
path: root/qa/qa/specs/features/shared_contexts/advanced_search_shared_context.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/specs/features/shared_contexts/advanced_search_shared_context.rb')
-rw-r--r--qa/qa/specs/features/shared_contexts/advanced_search_shared_context.rb23
1 files changed, 15 insertions, 8 deletions
diff --git a/qa/qa/specs/features/shared_contexts/advanced_search_shared_context.rb b/qa/qa/specs/features/shared_contexts/advanced_search_shared_context.rb
index c6836d11803..805e5ce782a 100644
--- a/qa/qa/specs/features/shared_contexts/advanced_search_shared_context.rb
+++ b/qa/qa/specs/features/shared_contexts/advanced_search_shared_context.rb
@@ -8,18 +8,25 @@ module QA
QA::EE::Resource::Settings::Elasticsearch.fabricate_via_api! unless advanced_search_on
end
- after do
- Runtime::Search.disable_elasticsearch(api_client) if !advanced_search_on && !api_client.nil?
- end
+ # TODO: convert check_advanced_search_status method to use the API instead of the UI once the functionality exists
+ # https://gitlab.com/gitlab-org/gitlab/-/issues/382849 and then we can resume turning off advanced search after the
+ # tests as in the `after` block here. For now the advanced search tests will have the side effect of turning on
+ # advanced search if it wasn't enabled before the tests run.
+
+ # after do
+ # Runtime::Search.disable_elasticsearch(api_client) if !advanced_search_on && !api_client.nil?
+ # end
- # TODO: convert this method to use the API instead of the UI once the functionality exists
- # https://gitlab.com/gitlab-org/gitlab/-/issues/382849
def check_advanced_search_status
Flow::Login.sign_in
- QA::Page::Main::Menu.perform do |menu|
- menu.search_for('lorem ipsum')
+ QA::Support::Retrier.retry_on_exception(
+ max_attempts: Runtime::Search::RETRY_MAX_ITERATION,
+ sleep_interval: Runtime::Search::RETRY_SLEEP_INTERVAL) do
+ QA::Page::Main::Menu.perform do |menu|
+ menu.search_for('lorem ipsum')
+ end
+ page.has_text?('Advanced search is enabled')
end
- page.has_text?('Advanced search is enabled')
end
end
end