Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-15 00:09:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-15 00:09:08 +0300
commit866ca4e49ff74ffadf8e6f6ff663a168489c2aba (patch)
treecc3135b1bae11dbd1cb3a30cb547473ad89a5551 /qa
parent26a50872e9da9509c52c70f74dc21698fec906db (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r--qa/qa.rb4
-rw-r--r--qa/qa/page/group/menu.rb13
-rw-r--r--qa/qa/page/group/sub_menus/common.rb21
-rw-r--r--qa/qa/page/project/sub_menus/common.rb18
-rw-r--r--qa/qa/page/sub_menus/common.rb50
5 files changed, 74 insertions, 32 deletions
diff --git a/qa/qa.rb b/qa/qa.rb
index 53a43e8da64..fb0c06e33aa 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -159,6 +159,10 @@ module QA
autoload :Validator, 'qa/page/validator'
autoload :Validatable, 'qa/page/validatable'
+ module SubMenus
+ autoload :Common, 'qa/page/sub_menus/common'
+ end
+
module Main
autoload :Login, 'qa/page/main/login'
autoload :Menu, 'qa/page/main/menu'
diff --git a/qa/qa/page/group/menu.rb b/qa/qa/page/group/menu.rb
index 2b3b872aff4..230511ce6f6 100644
--- a/qa/qa/page/group/menu.rb
+++ b/qa/qa/page/group/menu.rb
@@ -13,15 +13,22 @@ module QA
element :contribution_analytics_link
end
+ view 'app/views/layouts/nav/sidebar/_analytics_links.html.haml' do
+ element :analytics_link
+ element :analytics_sidebar_submenu
+ end
+
def click_group_members_item
within_sidebar do
click_element(:group_members_item)
end
end
- def click_group_analytics_item
- within_sidebar do
- click_element(:contribution_analytics_link)
+ def click_contribution_analytics_item
+ hover_element(:analytics_link) do
+ within_submenu(:analytics_sidebar_submenu) do
+ click_element(:contribution_analytics_link)
+ end
end
end
diff --git a/qa/qa/page/group/sub_menus/common.rb b/qa/qa/page/group/sub_menus/common.rb
index a378db80e4b..96efc8da98d 100644
--- a/qa/qa/page/group/sub_menus/common.rb
+++ b/qa/qa/page/group/sub_menus/common.rb
@@ -5,6 +5,8 @@ module QA
module Group
module SubMenus
module Common
+ include QA::Page::SubMenus::Common
+
def self.included(base)
base.class_eval do
view 'app/views/layouts/nav/sidebar/_group.html.haml' do
@@ -13,23 +15,10 @@ module QA
end
end
- def hover_element(element)
- within_sidebar do
- find_element(element).hover
- yield
- end
- end
+ private
- def within_sidebar
- within_element(:group_sidebar) do
- yield
- end
- end
-
- def within_submenu(element)
- within_element(element) do
- yield
- end
+ def sidebar_element
+ :group_sidebar
end
end
end
diff --git a/qa/qa/page/project/sub_menus/common.rb b/qa/qa/page/project/sub_menus/common.rb
index 3c9e8085748..da759398cff 100644
--- a/qa/qa/page/project/sub_menus/common.rb
+++ b/qa/qa/page/project/sub_menus/common.rb
@@ -5,20 +5,12 @@ module QA
module Project
module SubMenus
module Common
- def within_sidebar
- within('.sidebar-top-level-items') do
- yield
- end
- end
+ include QA::Page::SubMenus::Common
+
+ private
- def within_submenu
- if has_css?('.fly-out-list')
- within('.fly-out-list') do
- yield
- end
- else
- yield
- end
+ def sidebar_element
+ :project_sidebar
end
end
end
diff --git a/qa/qa/page/sub_menus/common.rb b/qa/qa/page/sub_menus/common.rb
new file mode 100644
index 00000000000..0eb1b100bd7
--- /dev/null
+++ b/qa/qa/page/sub_menus/common.rb
@@ -0,0 +1,50 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module SubMenus
+ module Common
+ def hover_element(element)
+ within_sidebar do
+ find_element(element).hover
+ yield
+ end
+ end
+
+ def within_sidebar
+ within_element(sidebar_element) do
+ yield
+ end
+ end
+
+ def within_submenu(element = nil)
+ if element
+ within_element(element) do
+ yield
+ end
+ else
+ within_submenu_without_element do
+ yield
+ end
+ end
+ end
+
+ private
+
+ def within_submenu_without_element
+ if has_css?('.fly-out-list')
+ within('.fly-out-list') do
+ yield
+ end
+ else
+ yield
+ end
+ end
+
+ def sidebar_element
+ raise NotImplementedError
+ end
+ end
+ end
+ end
+end