summaryrefslogtreecommitdiff
path: root/qa/qa/page/project/operations
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-05-18 17:33:57 +0200
committerDylan Griffith <dyl.griffith@gmail.com>2018-06-04 17:20:48 +0200
commit2ae48f1ca910031a77550e1f85492d9786c3069e (patch)
treecc9c70d691e9f0158fb1e33759e5d3eff63ba4bd /qa/qa/page/project/operations
parent8d2b4e02e50f4830f27ad91a0afa1676759fc426 (diff)
downloadgitlab-ce-2ae48f1ca910031a77550e1f85492d9786c3069e.tar.gz
Add QA integration test for full Auto DevOps flow
Diffstat (limited to 'qa/qa/page/project/operations')
-rw-r--r--qa/qa/page/project/operations/kubernetes/add.rb19
-rw-r--r--qa/qa/page/project/operations/kubernetes/add_existing.rb39
-rw-r--r--qa/qa/page/project/operations/kubernetes/index.rb19
-rw-r--r--qa/qa/page/project/operations/kubernetes/show.rb39
4 files changed, 116 insertions, 0 deletions
diff --git a/qa/qa/page/project/operations/kubernetes/add.rb b/qa/qa/page/project/operations/kubernetes/add.rb
new file mode 100644
index 00000000000..9b3c482fa6c
--- /dev/null
+++ b/qa/qa/page/project/operations/kubernetes/add.rb
@@ -0,0 +1,19 @@
+module QA
+ module Page
+ module Project
+ module Operations
+ module Kubernetes
+ class Add < Page::Base
+ view 'app/views/projects/clusters/new.html.haml' do
+ element :add_kubernetes_cluster_button, "link_to s_('ClusterIntegration|Add an existing Kubernetes cluster')"
+ end
+
+ def add_existing_cluster
+ click_on 'Add an existing Kubernetes cluster'
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/operations/kubernetes/add_existing.rb b/qa/qa/page/project/operations/kubernetes/add_existing.rb
new file mode 100644
index 00000000000..eef82b5f329
--- /dev/null
+++ b/qa/qa/page/project/operations/kubernetes/add_existing.rb
@@ -0,0 +1,39 @@
+module QA
+ module Page
+ module Project
+ module Operations
+ module Kubernetes
+ class AddExisting < Page::Base
+ view 'app/views/projects/clusters/user/_form.html.haml' do
+ element :cluster_name, 'text_field :name'
+ element :api_url, 'text_field :api_url'
+ element :ca_certificate, 'text_area :ca_cert'
+ element :token, 'text_field :token'
+ element :add_cluster_button, "submit s_('ClusterIntegration|Add Kubernetes cluster')"
+ 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
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/operations/kubernetes/index.rb b/qa/qa/page/project/operations/kubernetes/index.rb
new file mode 100644
index 00000000000..7261b5645da
--- /dev/null
+++ b/qa/qa/page/project/operations/kubernetes/index.rb
@@ -0,0 +1,19 @@
+module QA
+ module Page
+ module Project
+ module Operations
+ module Kubernetes
+ class Index < Page::Base
+ view 'app/views/projects/clusters/_empty_state.html.haml' do
+ element :add_kubernetes_cluster_button, "link_to s_('ClusterIntegration|Add Kubernetes cluster')"
+ end
+
+ def add_kubernetes_cluster
+ click_on 'Add Kubernetes cluster'
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/operations/kubernetes/show.rb b/qa/qa/page/project/operations/kubernetes/show.rb
new file mode 100644
index 00000000000..4923304133e
--- /dev/null
+++ b/qa/qa/page/project/operations/kubernetes/show.rb
@@ -0,0 +1,39 @@
+module QA
+ module Page
+ module Project
+ module Operations
+ module Kubernetes
+ class Show < Page::Base
+ view 'app/assets/javascripts/clusters/components/application_row.vue' do
+ element :application_row, 'js-cluster-application-row-${this.id}'
+ element :install_button, "s__('ClusterIntegration|Install')"
+ element :installed_button, "s__('ClusterIntegration|Installed')"
+ end
+
+ view 'app/assets/javascripts/clusters/components/applications.vue' do
+ element :ingress_ip_address, 'id="ingress-ip-address"'
+ end
+
+ def install!(application_name)
+ within(".js-cluster-application-row-#{application_name}") do
+ click_on 'Install'
+ end
+ end
+
+ def await_installed(application_name)
+ within(".js-cluster-application-row-#{application_name}") do
+ page.has_text?('Installed', wait: 300)
+ end
+ end
+
+ def ingress_ip
+ # We need to wait longer since it can take some time before the
+ # ip address is assigned for the ingress controller
+ page.find('#ingress-ip-address', wait: 500).value
+ end
+ end
+ end
+ end
+ end
+ end
+end