diff options
Diffstat (limited to 'qa/qa/mobile')
-rw-r--r-- | qa/qa/mobile/page/main/menu.rb | 60 | ||||
-rw-r--r-- | qa/qa/mobile/page/profile/menu.rb | 26 | ||||
-rw-r--r-- | qa/qa/mobile/page/project/issue/show.rb | 37 | ||||
-rw-r--r-- | qa/qa/mobile/page/project/show.rb | 31 | ||||
-rw-r--r-- | qa/qa/mobile/page/sub_menus/common.rb | 28 |
5 files changed, 182 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 diff --git a/qa/qa/mobile/page/profile/menu.rb b/qa/qa/mobile/page/profile/menu.rb new file mode 100644 index 00000000000..34c53a95e03 --- /dev/null +++ b/qa/qa/mobile/page/profile/menu.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module QA + module Mobile + module Page + module Profile + module Menu + extend QA::Page::PageConcern + + def self.prepended(base) + super + + base.class_eval do + prepend QA::Mobile::Page::Main::Menu + end + end + + def within_sidebar + open_mobile_nav_sidebar + super + end + end + end + end + end +end diff --git a/qa/qa/mobile/page/project/issue/show.rb b/qa/qa/mobile/page/project/issue/show.rb new file mode 100644 index 00000000000..017ecebcb69 --- /dev/null +++ b/qa/qa/mobile/page/project/issue/show.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module QA + module Mobile + module Page + module Project + module Issue + module Show + extend QA::Page::PageConcern + + def self.prepended(base) + super + + base.class_eval do + view 'app/assets/javascripts/issue_show/components/header_actions.vue' do + element :issue_actions_dropdown + element :mobile_close_issue_button + element :mobile_reopen_issue_button + end + end + end + + def click_close_issue_button + find('[data-qa-selector="issue_actions_dropdown"] > button').click + find_element(:mobile_close_issue_button, visible: false).click + end + + def has_reopen_issue_button? + find('[data-qa-selector="issue_actions_dropdown"] > button').click + has_element?(:mobile_reopen_issue_button) + end + end + end + end + end + end +end diff --git a/qa/qa/mobile/page/project/show.rb b/qa/qa/mobile/page/project/show.rb new file mode 100644 index 00000000000..8a0a222c852 --- /dev/null +++ b/qa/qa/mobile/page/project/show.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module QA + module Mobile + module Page + module Project + module Show + extend QA::Page::PageConcern + + def self.prepended(base) + super + + base.class_eval do + prepend QA::Mobile::Page::Main::Menu + + view 'app/assets/javascripts/nav/components/top_nav_new_dropdown.vue' do + element :new_issue_mobile_button + end + end + end + + def go_to_new_issue + open_mobile_new_dropdown + + click_element(:new_issue_mobile_button) + end + end + end + end + end +end diff --git a/qa/qa/mobile/page/sub_menus/common.rb b/qa/qa/mobile/page/sub_menus/common.rb new file mode 100644 index 00000000000..6a0477a3f31 --- /dev/null +++ b/qa/qa/mobile/page/sub_menus/common.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module QA + module Mobile + module Page + module SubMenus + module Common + def open_mobile_nav_sidebar + if has_element?(:project_sidebar, visible: false) + Support::Retrier.retry_until do + click_element(:toggle_mobile_nav_button) + has_element?(:project_sidebar, visible: true) + end + end + end + + def within_sidebar + wait_for_requests + + open_mobile_nav_sidebar + + super + end + end + end + end + end +end |