summaryrefslogtreecommitdiff
path: root/qa/qa/page/project/sub_menus/common.rb
blob: 3c9e8085748f850840eb49c74ff44edce6ca9a3b (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
# frozen_string_literal: true

module QA
  module Page
    module Project
      module SubMenus
        module Common
          def within_sidebar
            within('.sidebar-top-level-items') do
              yield
            end
          end

          def within_submenu
            if has_css?('.fly-out-list')
              within('.fly-out-list') do
                yield
              end
            else
              yield
            end
          end
        end
      end
    end
  end
end