blob: 1e9e088ac54800a52db952d8b354a6b0dc2402a1 (
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
module Settings
class PackageRegistries < QA::Page::Base
include ::QA::Page::Settings::Common
view 'app/assets/javascripts/packages_and_registries/settings/group/components/packages_settings.vue' do
element :package_registry_settings_content
element :allow_duplicates_toggle
element :allow_duplicates_label
end
view 'app/assets/javascripts/packages_and_registries/settings/group/components/dependency_proxy_settings.vue' do
element :dependency_proxy_settings_content
element :dependency_proxy_setting_toggle
end
def set_allow_duplicates_disabled
expand_content :package_registry_settings_content do
click_on_allow_duplicates_button if duplicates_enabled?
end
end
def set_allow_duplicates_enabled
expand_content :package_registry_settings_content do
click_on_allow_duplicates_button unless duplicates_enabled?
end
end
def click_on_allow_duplicates_button
with_allow_duplicates_button do |button|
button.click
end
end
def duplicates_enabled?
with_allow_duplicates_button do |button|
button[:class].include?('is-checked')
end
end
def with_allow_duplicates_button
within_element :allow_duplicates_toggle do
toggle = find('button.gl-toggle')
yield(toggle)
end
end
def has_dependency_proxy_enabled?
expand_content :dependency_proxy_settings_content do
within_element :dependency_proxy_setting_toggle do
toggle = find('button.gl-toggle')
toggle[:class].include?('is-checked')
end
end
end
end
end
end
end
end
|