summaryrefslogtreecommitdiff
path: root/qa/qa/page/project/settings/services/prometheus.rb
blob: 8ae4ded535e340b4fce5938679277533980c3a01 (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
# frozen_string_literal: true

module QA
  module Page
    module Project
      module Settings
        module Services
          class Prometheus < Page::Base
            include Page::Component::CustomMetric

            view 'app/views/projects/services/prometheus/_custom_metrics.html.haml' do
              element :custom_metrics_container
              element :new_metric_button
            end

            def click_on_custom_metric(custom_metric)
              within_element :custom_metrics_container do
                click_on custom_metric
              end
            end

            def click_on_new_metric
              click_element :new_metric_button
            end

            def has_custom_metric?(custom_metric)
              within_element :custom_metrics_container do
                has_text? custom_metric
              end
            end
          end
        end
      end
    end
  end
end