summaryrefslogtreecommitdiff
path: root/qa/qa/page/project/settings/incidents.rb
blob: 94d5fc369ad5761c89bf4460b0c030032144daf3 (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
# frozen_string_literal: true

module QA
  module Page
    module Project
      module Settings
        class Incidents < Page::Base
          view 'app/views/projects/settings/operations/_incidents.html.haml' do
            element :create_issue_checkbox
            element :incident_templates_dropdown
            element :save_changes_button
          end

          def enable_issues_for_incidents
            check_element :create_issue_checkbox
          end

          def select_issue_template(template)
            within_element :incident_templates_dropdown do
              find(:option, template).select_option
            end
          end

          def save_incident_settings
            click_element :save_changes_button
          end

          def has_template?(template)
            within_element :incident_templates_dropdown do
              has_text?(template)
            end
          end
        end
      end
    end
  end
end