summaryrefslogtreecommitdiff
path: root/qa/qa/page/group/sub_menus/common.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-13 13:26:31 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-13 13:26:31 +0000
commitb7dfe2ae4054aa40e15182fd3c6cb7dd39f131db (patch)
tree5ab080ca9cadeb6cd9578bf301e4e9e8810bed9e /qa/qa/page/group/sub_menus/common.rb
parent25cb337cf12438169f1b14bc5dace8a06a7356e3 (diff)
downloadgitlab-ce-b7dfe2ae4054aa40e15182fd3c6cb7dd39f131db.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/qa/page/group/sub_menus/common.rb')
-rw-r--r--qa/qa/page/group/sub_menus/common.rb38
1 files changed, 38 insertions, 0 deletions
diff --git a/qa/qa/page/group/sub_menus/common.rb b/qa/qa/page/group/sub_menus/common.rb
new file mode 100644
index 00000000000..a378db80e4b
--- /dev/null
+++ b/qa/qa/page/group/sub_menus/common.rb
@@ -0,0 +1,38 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Group
+ module SubMenus
+ module Common
+ def self.included(base)
+ base.class_eval do
+ view 'app/views/layouts/nav/sidebar/_group.html.haml' do
+ element :group_sidebar
+ end
+ end
+ end
+
+ def hover_element(element)
+ within_sidebar do
+ find_element(element).hover
+ yield
+ end
+ end
+
+ def within_sidebar
+ within_element(:group_sidebar) do
+ yield
+ end
+ end
+
+ def within_submenu(element)
+ within_element(element) do
+ yield
+ end
+ end
+ end
+ end
+ end
+ end
+end