blob: 52e5593cb26430b4bcedce3cbc263074591f8950 (
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
|
# frozen_string_literal: true
module QA
module Page
module Group
class BulkImport < Page::Base
view "app/assets/javascripts/import_entities/import_groups/components/import_table.vue" do
element :import_table
element :import_item
element :import_status_indicator
element 'filter-groups'
end
view "app/assets/javascripts/import_entities/components/import_target_dropdown.vue" do
element 'target-namespace-dropdown'
end
view "app/assets/javascripts/import_entities/import_groups/components/import_actions_cell.vue" do
element 'import-group-button'
end
def filter_group(source_group_name)
find('input[data-testid="filter-groups"]').set(source_group_name).send_keys(:return)
finished_loading?
end
# Import source group in to target group
#
# @param [String] source_group_name
# @param [String] target_group_name
# @return [void]
def import_group(source_group_name, target_group_name)
finished_loading?
filter_group(source_group_name)
within_element(:import_item, source_group: source_group_name) do
click_element('target-namespace-dropdown')
click_element("listbox-item-#{target_group_name}")
retry_until(message: "Triggering import") do
click_element('import-group-button')
# Make sure import started before waiting for completion
has_no_element?(:import_status_indicator, text: "Not started", wait: 1)
end
end
end
# Check if import page has a successfully imported group
#
# @param [String] source_group_name
# @param [Integer] wait
# @return [Boolean]
def has_imported_group?(source_group_name, wait: QA::Support::WaitForRequests::DEFAULT_MAX_WAIT_TIME)
within_element(:import_item, source_group: source_group_name) do
has_element?(:import_status_indicator, text: "Complete", wait: wait)
end
end
end
end
end
end
|