summaryrefslogtreecommitdiff
path: root/qa/qa/page/clusters/shared/add_existing.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/page/clusters/shared/add_existing.rb')
-rw-r--r--qa/qa/page/clusters/shared/add_existing.rb44
1 files changed, 44 insertions, 0 deletions
diff --git a/qa/qa/page/clusters/shared/add_existing.rb b/qa/qa/page/clusters/shared/add_existing.rb
new file mode 100644
index 00000000000..c1cd87d34fa
--- /dev/null
+++ b/qa/qa/page/clusters/shared/add_existing.rb
@@ -0,0 +1,44 @@
+module QA
+ module Page
+ module Clusters
+ module Shared
+ module AddExisting
+ def self.included(base)
+ base.view 'app/views/clusters/clusters/user/_form.html.haml' do
+ element :cluster_name, 'text_field :name' # rubocop:disable QA/ElementWithPattern
+ element :api_url, 'text_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_cluster_button, "submit s_('ClusterIntegration|Add Kubernetes cluster')" # rubocop:disable QA/ElementWithPattern
+ element :rbac_checkbox
+ end
+ 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_on 'Add Kubernetes cluster'
+ end
+
+ def check_rbac!
+ check_element :rbac_checkbox
+ end
+ end
+ end
+ end
+ end
+end