summaryrefslogtreecommitdiff
path: root/qa/qa/page
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/page')
-rw-r--r--qa/qa/page/clusters/shared/add.rb19
-rw-r--r--qa/qa/page/clusters/shared/add_existing.rb44
-rw-r--r--qa/qa/page/clusters/shared/index.rb19
-rw-r--r--qa/qa/page/clusters/shared/show.rb40
-rw-r--r--qa/qa/page/group/kubernetes/kubernetes/add.rb13
-rw-r--r--qa/qa/page/group/kubernetes/kubernetes/add_existing.rb13
-rw-r--r--qa/qa/page/group/kubernetes/kubernetes/index.rb13
-rw-r--r--qa/qa/page/group/kubernetes/kubernetes/show.rb13
-rw-r--r--qa/qa/page/group/menu.rb28
-rw-r--r--qa/qa/page/project/operations/kubernetes/add.rb8
-rw-r--r--qa/qa/page/project/operations/kubernetes/add_existing.rb33
-rw-r--r--qa/qa/page/project/operations/kubernetes/index.rb8
-rw-r--r--qa/qa/page/project/operations/kubernetes/show.rb29
13 files changed, 206 insertions, 74 deletions
diff --git a/qa/qa/page/clusters/shared/add.rb b/qa/qa/page/clusters/shared/add.rb
new file mode 100644
index 00000000000..29c8eb4d22a
--- /dev/null
+++ b/qa/qa/page/clusters/shared/add.rb
@@ -0,0 +1,19 @@
+module QA
+ module Page
+ module Clusters
+ module Shared
+ module Add
+ def self.included(base)
+ base.view 'app/views/clusters/clusters/new.html.haml' do
+ element :add_existing_cluster_button, "Add existing cluster"
+ end
+ end
+
+ def add_existing_cluster
+ click_on 'Add existing cluster'
+ end
+ end
+ end
+ end
+ end
+end
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
diff --git a/qa/qa/page/clusters/shared/index.rb b/qa/qa/page/clusters/shared/index.rb
new file mode 100644
index 00000000000..1ae8eb4fa7e
--- /dev/null
+++ b/qa/qa/page/clusters/shared/index.rb
@@ -0,0 +1,19 @@
+module QA
+ module Page
+ module Clusters
+ module Shared
+ module Index
+ def self.included(base)
+ base.view 'app/views/clusters/clusters/_empty_state.html.haml' do
+ element :add_kubernetes_cluster_button, "link_to s_('ClusterIntegration|Add Kubernetes cluster')" # rubocop:disable QA/ElementWithPattern
+ end
+ end
+
+ def add_kubernetes_cluster
+ click_on 'Add Kubernetes cluster'
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/clusters/shared/show.rb b/qa/qa/page/clusters/shared/show.rb
new file mode 100644
index 00000000000..d516d1e36ba
--- /dev/null
+++ b/qa/qa/page/clusters/shared/show.rb
@@ -0,0 +1,40 @@
+module QA
+ module Page
+ module Clusters
+ module Shared
+ module Show
+ def self.included(base)
+ base.view 'app/assets/javascripts/clusters/components/application_row.vue' do
+ element :application_row, 'js-cluster-application-row-${this.id}' # rubocop:disable QA/ElementWithPattern
+ element :install_button, "s__('ClusterIntegration|Install')" # rubocop:disable QA/ElementWithPattern
+ element :installed_button, "s__('ClusterIntegration|Installed')" # rubocop:disable QA/ElementWithPattern
+ end
+
+ base.view 'app/assets/javascripts/clusters/components/applications.vue' do
+ element :ingress_ip_address, 'id="ingress-ip-address"' # rubocop:disable QA/ElementWithPattern
+ end
+ end
+
+ def install!(application_name)
+ within(".js-cluster-application-row-#{application_name}") do
+ page.has_button?('Install', wait: 30)
+ 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
diff --git a/qa/qa/page/group/kubernetes/kubernetes/add.rb b/qa/qa/page/group/kubernetes/kubernetes/add.rb
new file mode 100644
index 00000000000..cdf2d56610d
--- /dev/null
+++ b/qa/qa/page/group/kubernetes/kubernetes/add.rb
@@ -0,0 +1,13 @@
+module QA
+ module Page
+ module Group
+ module Kubernetes
+ module Kubernetes
+ class Add < Page::Base
+ include QA::Page::Clusters::Shared::Add
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/group/kubernetes/kubernetes/add_existing.rb b/qa/qa/page/group/kubernetes/kubernetes/add_existing.rb
new file mode 100644
index 00000000000..3779613c37d
--- /dev/null
+++ b/qa/qa/page/group/kubernetes/kubernetes/add_existing.rb
@@ -0,0 +1,13 @@
+module QA
+ module Page
+ module Group
+ module Kubernetes
+ module Kubernetes
+ class AddExisting < Page::Base
+ include QA::Page::Clusters::Shared::AddExisting
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/group/kubernetes/kubernetes/index.rb b/qa/qa/page/group/kubernetes/kubernetes/index.rb
new file mode 100644
index 00000000000..66fb80913c8
--- /dev/null
+++ b/qa/qa/page/group/kubernetes/kubernetes/index.rb
@@ -0,0 +1,13 @@
+module QA
+ module Page
+ module Group
+ module Kubernetes
+ module Kubernetes
+ class Index < Page::Base
+ include QA::Page::Clusters::Shared::Index
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/group/kubernetes/kubernetes/show.rb b/qa/qa/page/group/kubernetes/kubernetes/show.rb
new file mode 100644
index 00000000000..39e398b2795
--- /dev/null
+++ b/qa/qa/page/group/kubernetes/kubernetes/show.rb
@@ -0,0 +1,13 @@
+module QA
+ module Page
+ module Group
+ module Kubernetes
+ module Kubernetes
+ class Show < Page::Base
+ include QA::Page::Clusters::Shared::Show
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/group/menu.rb b/qa/qa/page/group/menu.rb
new file mode 100644
index 00000000000..77ce28e7a43
--- /dev/null
+++ b/qa/qa/page/group/menu.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Group
+ class Menu < Page::Base
+ view 'app/views/layouts/nav/sidebar/_group.html.haml' do
+ element :group_sidebar
+ element :kubernetes_kubernetes_link
+ end
+
+ def click_kubernetes_kubernetes
+ within_sidebar do
+ click_link(:kubernetes_kubernetes_link)
+ end
+ end
+
+ private
+
+ def within_sidebar
+ within_element(:group_sidebar) do
+ yield
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/operations/kubernetes/add.rb b/qa/qa/page/project/operations/kubernetes/add.rb
index 939f912ea85..3b42ed301c7 100644
--- a/qa/qa/page/project/operations/kubernetes/add.rb
+++ b/qa/qa/page/project/operations/kubernetes/add.rb
@@ -4,13 +4,7 @@ module QA
module Operations
module Kubernetes
class Add < Page::Base
- view 'app/views/clusters/clusters/new.html.haml' do
- element :add_existing_cluster_button, "Add existing cluster" # rubocop:disable QA/ElementWithPattern
- end
-
- def add_existing_cluster
- click_on 'Add existing cluster'
- end
+ include QA::Page::Clusters::Shared::Add
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
index f3ab636ecc1..af9e7ec1d86 100644
--- a/qa/qa/page/project/operations/kubernetes/add_existing.rb
+++ b/qa/qa/page/project/operations/kubernetes/add_existing.rb
@@ -4,38 +4,7 @@ module QA
module Operations
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, '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
-
- 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
+ include QA::Page::Clusters::Shared::AddExisting
end
end
end
diff --git a/qa/qa/page/project/operations/kubernetes/index.rb b/qa/qa/page/project/operations/kubernetes/index.rb
index 67a74af1cd2..d741ad465d7 100644
--- a/qa/qa/page/project/operations/kubernetes/index.rb
+++ b/qa/qa/page/project/operations/kubernetes/index.rb
@@ -4,13 +4,7 @@ module QA
module Operations
module Kubernetes
class Index < Page::Base
- view 'app/views/clusters/clusters/_empty_state.html.haml' do
- element :add_kubernetes_cluster_button, "link_to s_('ClusterIntegration|Add Kubernetes cluster')" # rubocop:disable QA/ElementWithPattern
- end
-
- def add_kubernetes_cluster
- click_on 'Add Kubernetes cluster'
- end
+ include QA::Page::Clusters::Shared::Index
end
end
end
diff --git a/qa/qa/page/project/operations/kubernetes/show.rb b/qa/qa/page/project/operations/kubernetes/show.rb
index 9e8f9ba79d7..fcceaa01429 100644
--- a/qa/qa/page/project/operations/kubernetes/show.rb
+++ b/qa/qa/page/project/operations/kubernetes/show.rb
@@ -4,34 +4,7 @@ module QA
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}' # rubocop:disable QA/ElementWithPattern
- element :install_button, "s__('ClusterIntegration|Install')" # rubocop:disable QA/ElementWithPattern
- element :installed_button, "s__('ClusterIntegration|Installed')" # rubocop:disable QA/ElementWithPattern
- end
-
- view 'app/assets/javascripts/clusters/components/applications.vue' do
- element :ingress_ip_address, 'id="ingress-ip-address"' # rubocop:disable QA/ElementWithPattern
- end
-
- def install!(application_name)
- within(".js-cluster-application-row-#{application_name}") do
- page.has_button?('Install', wait: 30)
- 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
+ include QA::Page::Clusters::Shared::Show
end
end
end