summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorMark Lapierre <mlapierre@gitlab.com>2019-01-24 16:54:57 +0000
committerMark Lapierre <mlapierre@gitlab.com>2019-01-24 16:54:57 +0000
commit664567a8c2956f048fd9f99b411b0a0236df2e70 (patch)
tree1cc08a57265206356a59b2a780861fd51774c6b6 /qa
parent8f606dc097114e54e8e83724d8eb8f1496e6c290 (diff)
parent29819c49c79d8af468c28714c5340d5ea8448ec7 (diff)
downloadgitlab-ce-664567a8c2956f048fd9f99b411b0a0236df2e70.tar.gz
Merge branch 'split-project-menu-into-separate-submenus' into 'master'
Split project menu into separate submenus See merge request gitlab-org/gitlab-ce!24501
Diffstat (limited to 'qa')
-rw-r--r--qa/qa.rb4
-rw-r--r--qa/qa/page/project/menu.rb136
-rw-r--r--qa/qa/page/project/sub_menus/ci_cd.rb25
-rw-r--r--qa/qa/page/project/sub_menus/issues.rb52
-rw-r--r--qa/qa/page/project/sub_menus/operations.rb47
-rw-r--r--qa/qa/page/project/sub_menus/settings.rb61
6 files changed, 200 insertions, 125 deletions
diff --git a/qa/qa.rb b/qa/qa.rb
index 2cbd74121f1..7aaf56bd51f 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -196,8 +196,12 @@ module QA
end
module SubMenus
+ autoload :CiCd, 'qa/page/project/sub_menus/ci_cd'
autoload :Common, 'qa/page/project/sub_menus/common'
+ autoload :Issues, 'qa/page/project/sub_menus/issues'
+ autoload :Operations, 'qa/page/project/sub_menus/operations'
autoload :Repository, 'qa/page/project/sub_menus/repository'
+ autoload :Settings, 'qa/page/project/sub_menus/settings'
end
module Issue
diff --git a/qa/qa/page/project/menu.rb b/qa/qa/page/project/menu.rb
index eb3426b1ac0..46dfe87fe25 100644
--- a/qa/qa/page/project/menu.rb
+++ b/qa/qa/page/project/menu.rb
@@ -5,148 +5,34 @@ module QA
module Project
class Menu < Page::Base
include SubMenus::Common
+
+ include SubMenus::CiCd
+ include SubMenus::Issues
+ include SubMenus::Operations
include SubMenus::Repository
+ include SubMenus::Settings
view 'app/views/layouts/nav/sidebar/_project.html.haml' do
- element :settings_item
- element :settings_link, 'link_to edit_project_path' # rubocop:disable QA/ElementWithPattern
- element :link_pipelines
- element :link_operations
- element :link_members_settings
- element :pipelines_settings_link, "title: _('CI / CD')" # rubocop:disable QA/ElementWithPattern
- element :operations_kubernetes_link, "title: _('Kubernetes')" # rubocop:disable QA/ElementWithPattern
- element :operations_environments_link
- element :issues_link, /link_to.*shortcuts-issues/ # rubocop:disable QA/ElementWithPattern
- element :issues_link_text, "Issues" # rubocop:disable QA/ElementWithPattern
- element :merge_requests_link, /link_to.*shortcuts-merge_requests/ # rubocop:disable QA/ElementWithPattern
- element :merge_requests_link_text, "Merge Requests" # rubocop:disable QA/ElementWithPattern
- element :top_level_items, '.sidebar-top-level-items' # rubocop:disable QA/ElementWithPattern
- element :activity_link, "title: _('Activity')" # rubocop:disable QA/ElementWithPattern
- element :wiki_link_text, "Wiki" # rubocop:disable QA/ElementWithPattern
- element :milestones_link
- element :labels_link
- end
-
- view 'app/assets/javascripts/fly_out_nav.js' do
- element :fly_out, "classList.add('fly-out-list')" # rubocop:disable QA/ElementWithPattern
- end
-
- def click_ci_cd_pipelines
- within_sidebar do
- click_element :link_pipelines
- end
- end
-
- def click_ci_cd_settings
- hover_settings do
- within_submenu do
- click_link('CI / CD')
- end
- end
- end
-
- def click_issues
- within_sidebar do
- click_link('Issues')
- end
- end
-
- def click_members_settings
- hover_settings do
- within_submenu do
- click_element :link_members_settings
- end
- end
+ element :activity_link
+ element :merge_requests_link
+ element :wiki_link
end
def click_merge_requests
within_sidebar do
- click_link('Merge Requests')
- end
- end
-
- def click_operations_environments
- hover_operations do
- within_submenu do
- click_element(:operations_environments_link)
- end
- end
- end
-
- def click_operations_kubernetes
- hover_operations do
- within_submenu do
- click_link('Kubernetes')
- end
- end
- end
-
- def click_milestones
- within_sidebar do
- click_element :milestones_link
- end
- end
-
- def click_repository_settings
- hover_settings do
- within_submenu do
- click_link('Repository')
- end
+ click_element(:merge_requests_link)
end
end
def click_wiki
within_sidebar do
- click_link('Wiki')
+ click_element(:wiki_link)
end
end
def go_to_activity
within_sidebar do
- click_on 'Activity'
- end
- end
-
- def go_to_labels
- hover_issues do
- within_submenu do
- click_element(:labels_link)
- end
- end
- end
-
- def go_to_settings
- within_sidebar do
- click_on 'Settings'
- end
- end
-
- private
-
- def hover_issues
- within_sidebar do
- scroll_to_element(:issues_item)
- find_element(:issues_item).hover
-
- yield
- end
- end
-
- def hover_operations
- within_sidebar do
- scroll_to_element(:link_operations)
- find_element(:link_operations).hover
-
- yield
- end
- end
-
- def hover_settings
- within_sidebar do
- scroll_to_element(:settings_item)
- find_element(:settings_item).hover
-
- yield
+ click_element(:activity_link)
end
end
end
diff --git a/qa/qa/page/project/sub_menus/ci_cd.rb b/qa/qa/page/project/sub_menus/ci_cd.rb
new file mode 100644
index 00000000000..adae2ce08c4
--- /dev/null
+++ b/qa/qa/page/project/sub_menus/ci_cd.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module SubMenus
+ module CiCd
+ def self.included(base)
+ base.class_eval do
+ view 'app/views/layouts/nav/sidebar/_project.html.haml' do
+ element :link_pipelines
+ end
+ end
+ end
+
+ def click_ci_cd_pipelines
+ within_sidebar do
+ click_element :link_pipelines
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/sub_menus/issues.rb b/qa/qa/page/project/sub_menus/issues.rb
new file mode 100644
index 00000000000..f81e4f34909
--- /dev/null
+++ b/qa/qa/page/project/sub_menus/issues.rb
@@ -0,0 +1,52 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module SubMenus
+ module Issues
+ def self.included(base)
+ base.class_eval do
+ view 'app/views/layouts/nav/sidebar/_project.html.haml' do
+ element :issues_item
+ element :labels_link
+ element :milestones_link
+ end
+ end
+ end
+
+ def click_issues
+ within_sidebar do
+ click_link('Issues')
+ end
+ end
+
+ def click_milestones
+ within_sidebar do
+ click_element :milestones_link
+ end
+ end
+
+ def go_to_labels
+ hover_issues do
+ within_submenu do
+ click_element(:labels_link)
+ end
+ end
+ end
+
+ private
+
+ def hover_issues
+ within_sidebar do
+ scroll_to_element(:issues_item)
+ find_element(:issues_item).hover
+
+ yield
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/sub_menus/operations.rb b/qa/qa/page/project/sub_menus/operations.rb
new file mode 100644
index 00000000000..cf9fc453565
--- /dev/null
+++ b/qa/qa/page/project/sub_menus/operations.rb
@@ -0,0 +1,47 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module SubMenus
+ module Operations
+ def self.included(base)
+ base.class_eval do
+ view 'app/views/layouts/nav/sidebar/_project.html.haml' do
+ element :link_operations
+ element :operations_environments_link
+ end
+ end
+ end
+
+ def click_operations_environments
+ hover_operations do
+ within_submenu do
+ click_element(:operations_environments_link)
+ end
+ end
+ end
+
+ def click_operations_kubernetes
+ hover_operations do
+ within_submenu do
+ click_link('Kubernetes')
+ end
+ end
+ end
+
+ private
+
+ def hover_operations
+ within_sidebar do
+ scroll_to_element(:link_operations)
+ find_element(:link_operations).hover
+
+ yield
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/sub_menus/settings.rb b/qa/qa/page/project/sub_menus/settings.rb
new file mode 100644
index 00000000000..62c594c0210
--- /dev/null
+++ b/qa/qa/page/project/sub_menus/settings.rb
@@ -0,0 +1,61 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module SubMenus
+ module Settings
+ def self.included(base)
+ base.class_eval do
+ view 'app/views/layouts/nav/sidebar/_project.html.haml' do
+ element :settings_item
+ element :link_members_settings
+ end
+ end
+ end
+
+ def click_ci_cd_settings
+ hover_settings do
+ within_submenu do
+ click_link('CI / CD')
+ end
+ end
+ end
+
+ def click_members_settings
+ hover_settings do
+ within_submenu do
+ click_element :link_members_settings
+ end
+ end
+ end
+
+ def click_repository_settings
+ hover_settings do
+ within_submenu do
+ click_link('Repository')
+ end
+ end
+ end
+
+ def go_to_settings
+ within_sidebar do
+ click_on 'Settings'
+ end
+ end
+
+ private
+
+ def hover_settings
+ within_sidebar do
+ scroll_to_element(:settings_item)
+ find_element(:settings_item).hover
+
+ yield
+ end
+ end
+ end
+ end
+ end
+ end
+end