summaryrefslogtreecommitdiff
path: root/qa/qa/mobile/page/main/menu.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-11-18 13:16:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-18 13:16:36 +0000
commit311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch)
tree07e7870bca8aed6d61fdcc810731c50d2c40af47 /qa/qa/mobile/page/main/menu.rb
parent27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff)
downloadgitlab-ce-311b0269b4eb9839fa63f80c8d7a58f32b8138a0.tar.gz
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'qa/qa/mobile/page/main/menu.rb')
-rw-r--r--qa/qa/mobile/page/main/menu.rb60
1 files changed, 60 insertions, 0 deletions
diff --git a/qa/qa/mobile/page/main/menu.rb b/qa/qa/mobile/page/main/menu.rb
new file mode 100644
index 00000000000..40bb421b383
--- /dev/null
+++ b/qa/qa/mobile/page/main/menu.rb
@@ -0,0 +1,60 @@
+# frozen_string_literal: true
+
+module QA
+ module Mobile
+ module Page
+ module Main
+ module Menu
+ extend QA::Page::PageConcern
+
+ def self.prepended(base)
+ super
+
+ base.class_eval do
+ view 'app/views/layouts/header/_default.html.haml' do
+ element :mobile_navbar_button, required: true
+ end
+
+ view 'app/assets/javascripts/nav/components/responsive_home.vue' do
+ element :mobile_new_dropdown
+ end
+ end
+ end
+
+ def open_mobile_menu
+ if has_no_element?(:user_avatar)
+ Support::Retrier.retry_until do
+ click_element(:mobile_navbar_button)
+ has_element?(:user_avatar)
+ end
+ end
+ end
+
+ def open_mobile_new_dropdown
+ open_mobile_menu
+
+ Support::Retrier.retry_until do
+ find('[data-qa-selector="mobile_new_dropdown"] > button').click
+ has_css?('.dropdown-menu-right.show')
+ end
+ end
+
+ def has_personal_area?(wait: Capybara.default_max_wait_time)
+ open_mobile_menu
+ super
+ end
+
+ def has_no_personal_area?(wait: Capybara.default_max_wait_time)
+ open_mobile_menu
+ super
+ end
+
+ def within_user_menu
+ open_mobile_menu
+ super
+ end
+ end
+ end
+ end
+ end
+end