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

add_existing.rb « kubernetes « infrastructure « project « page « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2fc65cf0afe9fccead1cacf3ff1f2a75884c01f9 (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
# frozen_string_literal: true

module QA
  module Page
    module Project
      module Infrastructure
        module Kubernetes
          class AddExisting < Page::Base
            view 'app/views/clusters/clusters/user/_form.html.haml' do
              element :cluster_name, 'text_field :name' # rubocop:disable QA/ElementWithPattern
              element :api_url, 'url_field :api_url' # rubocop:disable QA/ElementWithPattern
              element :ca_certificate, 'text_area :ca_cert' # rubocop:disable QA/ElementWithPattern
              element :token, 'text_field :token' # rubocop:disable QA/ElementWithPattern
              element :add_kubernetes_cluster_button
              element :rbac_checkbox
            end

            def set_cluster_name(name)
              fill_in 'cluster_name', with: name
            end

            def set_api_url(api_url)
              fill_in 'cluster_platform_kubernetes_attributes_api_url', with: api_url
            end

            def set_ca_certificate(ca_certificate)
              fill_in 'cluster_platform_kubernetes_attributes_ca_cert', with: ca_certificate
            end

            def set_token(token)
              fill_in 'cluster_platform_kubernetes_attributes_token', with: token
            end

            def add_cluster!
              click_element :add_kubernetes_cluster_button, Page::Project::Infrastructure::Kubernetes::Show
            end

            def uncheck_rbac!
              uncheck_element(:rbac_checkbox)
            end
          end
        end
      end
    end
  end
end