blob: 7d0f8c0993317e7261136bfcb4a8c1855331f013 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# frozen_string_literal: true
module SearchHelpers
def fill_in_search(text)
# Once the `new_header_search` feature flag has been removed
# We can remove the `.search-input-wrap` selector
# https://gitlab.com/gitlab-org/gitlab/-/issues/339348
page.within('.header-search-new') do
find('#search').click
fill_in 'search', with: text
end
wait_for_all_requests
end
def submit_search(query)
# Once the `new_header_search` feature flag has been removed
# We can remove the `.search-form` selector
# https://gitlab.com/gitlab-org/gitlab/-/issues/339348
page.within('.header-search, .search-form, .search-page-form') do
field = find_field('search')
field.click
field.fill_in(with: query)
if javascript_test?
field.send_keys(:enter)
else
click_button('Search')
end
wait_for_all_requests
end
end
def select_search_scope(scope)
page.within '[data-testid="search-filter"]' do
click_link scope
end
end
def has_search_scope?(scope)
page.within '[data-testid="search-filter"]' do
has_link?(scope)
end
end
def max_limited_count
Gitlab::SearchResults::COUNT_LIMIT_MESSAGE
end
end
|