Welcome to mirror list, hosted at ThFree Co, Russian Federation.

operations.rb « sub_menus « project « page « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 077da697a63e1329c1507f2ccab295f30fb63c06 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# frozen_string_literal: true

module QA
  module Page
    module Project
      module SubMenus
        module Operations
          extend QA::Page::PageConcern

          def self.included(base)
            super

            base.class_eval do
              include QA::Page::Project::SubMenus::Common
            end
          end

          def go_to_operations_environments
            hover_operations do
              within_submenu do
                click_element(:sidebar_menu_item_link, menu_item: 'Environments')
              end
            end
          end

          def go_to_operations_metrics
            hover_operations do
              within_submenu do
                click_element(:sidebar_menu_item_link, menu_item: 'Metrics')
              end
            end
          end

          def go_to_operations_kubernetes
            hover_operations do
              within_submenu do
                click_link('Kubernetes')
              end
            end
          end

          def go_to_operations_incidents
            hover_operations do
              within_submenu do
                click_element(:sidebar_menu_item_link, menu_item: 'Incidents')
              end
            end
          end

          private

          def hover_operations
            within_sidebar do
              scroll_to_element(:sidebar_menu_link, menu_item: 'Operations')
              find_element(:sidebar_menu_link, menu_item: 'Operations').hover

              yield
            end
          end
        end
      end
    end
  end
end