summaryrefslogtreecommitdiff
path: root/qa/qa/page/project/infrastructure/kubernetes/index.rb
blob: 34d2ad554293a0309683183c6e72f598d97cf061 (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
# frozen_string_literal: true

module QA
  module Page
    module Project
      module Infrastructure
        module Kubernetes
          class Index < Page::Base
            view 'app/assets/javascripts/clusters_list/components/clusters_actions.vue' do
              element :clusters_actions_button
            end

            def connect_existing_cluster
              within_element(:clusters_actions_button) { click_button(class: 'dropdown-toggle-split') }
              click_link 'Connect a cluster (certificate - deprecated)'
            end

            def has_cluster?(cluster)
              has_element?(:cluster, cluster_name: cluster.to_s)
            end

            def click_on_cluster(cluster)
              click_on cluster.cluster_name
            end
          end
        end
      end
    end
  end
end