blob: 2d1af78046dc206658ded55df9ac4b86d585cf13 (
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
# frozen_string_literal: true
module QA
module Page
module Admin
class Menu < Page::Base
view 'app/views/layouts/nav/sidebar/_admin.html.haml' do
element :admin_sidebar
element :admin_sidebar_settings_submenu
element :admin_settings_item
element :admin_settings_repository_item
element :admin_settings_general_item
element :admin_settings_metrics_and_profiling_item
element :admin_settings_preferences_link
element :admin_monitoring_link
element :admin_sidebar_monitoring_submenu_content
element :admin_sidebar_overview_submenu_content
element :users_overview_link
end
view 'app/views/layouts/nav/sidebar/_admin.html.haml' do
element :integration_settings_link
end
def go_to_preferences_settings
hover_element(:admin_settings_item) do
within_submenu(:admin_sidebar_settings_submenu) do
click_element :admin_settings_preferences_link
end
end
end
def go_to_repository_settings
hover_element(:admin_settings_item) do
within_submenu(:admin_sidebar_settings_submenu) do
click_element :admin_settings_repository_item
end
end
end
def go_to_integration_settings
hover_element(:admin_settings_item) do
within_submenu(:admin_sidebar_settings_submenu) do
click_element :integration_settings_link
end
end
end
def go_to_general_settings
hover_element(:admin_settings_item) do
within_submenu(:admin_sidebar_settings_submenu) do
click_element :admin_settings_general_item
end
end
end
def go_to_metrics_and_profiling_settings
hover_element(:admin_settings_item) do
within_submenu(:admin_sidebar_settings_submenu) do
click_element :admin_settings_metrics_and_profiling_item
end
end
end
def go_to_network_settings
hover_element(:admin_settings_item) do
within_submenu(:admin_sidebar_settings_submenu) do
click_element :admin_settings_network_item
end
end
end
def go_to_users_overview
within_submenu(:admin_sidebar_overview_submenu_content) do
click_element :users_overview_link
end
end
private
def hover_element(element)
within_sidebar do
scroll_to_element(element)
find_element(element).hover
yield
end
end
def within_sidebar
within_element(:admin_sidebar) do
yield
end
end
def within_submenu(element)
within_element(element) do
yield
end
end
end
end
end
end
QA::Page::Admin::Menu.prepend_if_ee('QA::EE::Page::Admin::Menu')
|