blob: c5d261089532159238fbbdd01cc72eee6cfd1626 (
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# frozen_string_literal: true
module Spec
module Support
module Helpers
module Features
module RunnersHelpers
def within_runner_row(runner_id)
within "[data-testid='runner-row-#{runner_id}']" do
yield
end
end
def search_bar_selector
'[data-testid="runners-filtered-search"]'
end
# The filters must be clicked first to be able to receive events
# See: https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1493
def focus_filtered_search
page.within(search_bar_selector) do
page.find('.gl-filtered-search-term-token').click
end
end
def input_filtered_search_keys(search_term)
focus_filtered_search
page.within(search_bar_selector) do
page.find('input').send_keys(search_term)
click_on 'Search'
end
wait_for_requests
end
def open_filtered_search_suggestions(filter)
focus_filtered_search
page.within(search_bar_selector) do
click_on filter
end
wait_for_requests
end
def input_filtered_search_filter_is_only(filter, value)
focus_filtered_search
page.within(search_bar_selector) do
click_on filter
# For OPERATORS_IS, clicking the filter
# immediately preselects "=" operator
page.find('input').send_keys(value)
page.find('input').send_keys(:enter)
click_on 'Search'
end
wait_for_requests
end
end
end
end
end
end
|