summaryrefslogtreecommitdiff
path: root/qa/qa/mobile/page/sub_menus/common.rb
blob: 6a0477a3f316b02136bba13457e7fb8adaf0c681 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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