blob: ff61c91f0f6eab7f5ac2e724bb5fbca3c3070731 (
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
|
# frozen_string_literal: true
module QA
module Page
module Component
module GroupsFilter
extend QA::Page::PageConcern
def self.included(base)
super
base.view 'app/views/shared/groups/_search_form.html.haml' do
element :groups_filter_field
end
base.view 'app/assets/javascripts/groups/components/groups.vue' do
element :groups_list_tree_container
end
end
private
def has_filtered_group?(name)
# Filter and submit to reload the page and only retrieve the filtered results
find_element(:groups_filter_field).set(name).send_keys(:return)
# Since we submitted after filtering, the presence of
# groups_list_tree_container means we have the complete filtered list
# of groups
has_element?(:groups_list_tree_container, wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME)
# If there are no groups we'll know immediately because we filtered the list
return false if page.has_text?('No groups or projects matched your search', wait: 0)
# The name will be present as filter input so we check for a link, not text
page.has_link?(name, wait: 0)
end
end
end
end
end
|