summaryrefslogtreecommitdiff
path: root/qa/qa/page/project/settings/ci_cd.rb
blob: dfb71e0a9f08a8b757bab062080f6a52ff2210ef (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
module QA # rubocop:disable Naming/FileName
  module Page
    module Project
      module Settings
        class CICD < Page::Base
          include Common

          view 'app/views/projects/settings/ci_cd/show.html.haml' do
            element :runners_settings, 'Runners settings'
            element :secret_variables, 'Variables'
            element :auto_devops_section, 'Auto DevOps'
          end

          view 'app/views/projects/settings/ci_cd/_autodevops_form.html.haml' do
            element :enable_auto_devops_button, 'Enable Auto DevOps'
            element :domain_input, 'Domain'
            element :save_changes_button, "submit 'Save changes'"
          end

          def expand_runners_settings(&block)
            expand_section('Runners settings') do
              Settings::Runners.perform(&block)
            end
          end

          def expand_secret_variables(&block)
            expand_section('Variables') do
              Settings::SecretVariables.perform(&block)
            end
          end

          def enable_auto_devops_with_domain(domain)
            expand_section('Auto DevOps') do
              choose 'Enable Auto DevOps'
              fill_in 'Domain', with: domain
              click_on 'Save changes'
            end
          end
        end
      end
    end
  end
end