diff options
4 files changed, 22 insertions, 10 deletions
diff --git a/app/views/clusters/clusters/_form.html.haml b/app/views/clusters/clusters/_form.html.haml index 7acd9ce0562..9fb91a39387 100644 --- a/app/views/clusters/clusters/_form.html.haml +++ b/app/views/clusters/clusters/_form.html.haml @@ -28,7 +28,7 @@ .form-group %h5= s_('ClusterIntegration|Base domain') - = field.text_field :base_domain, class: 'col-md-6 form-control js-select-on-focus' + = field.text_field :base_domain, class: 'col-md-6 form-control js-select-on-focus qa-base-domain' .form-text.text-muted - auto_devops_url = help_page_path('topics/autodevops/index') - auto_devops_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: auto_devops_url } @@ -43,4 +43,4 @@ - if can?(current_user, :update_cluster, @cluster) .form-group - = field.submit _('Save changes'), class: 'btn btn-success' + = field.submit _('Save changes'), class: 'btn btn-success qa-save-domain' diff --git a/qa/qa/page/project/operations/kubernetes/show.rb b/qa/qa/page/project/operations/kubernetes/show.rb index 98ac5c32d91..d4e1679b6bf 100644 --- a/qa/qa/page/project/operations/kubernetes/show.rb +++ b/qa/qa/page/project/operations/kubernetes/show.rb @@ -14,6 +14,11 @@ module QA element :ingress_ip_address, 'id="ingress-ip-address"' # rubocop:disable QA/ElementWithPattern end + view 'app/views/clusters/clusters/_form.html.haml' do + element :base_domain + element :save_domain + end + def install!(application_name) within(".js-cluster-application-row-#{application_name}") do page.has_button?('Install', wait: 30) @@ -32,6 +37,14 @@ module QA # ip address is assigned for the ingress controller page.find('#ingress-ip-address', wait: 1200).value end + + def set_domain(domain) + fill_element :base_domain, domain + end + + def save_domain + click_element :save_domain + end end end end diff --git a/qa/qa/resource/kubernetes_cluster.rb b/qa/qa/resource/kubernetes_cluster.rb index 986b31da528..93a06be6818 100644 --- a/qa/qa/resource/kubernetes_cluster.rb +++ b/qa/qa/resource/kubernetes_cluster.rb @@ -12,10 +12,6 @@ module QA Page::Project::Operations::Kubernetes::Show.perform(&:ingress_ip) end - attribute :domain do - "#{ingress_ip}.nip.io" - end - def fabricate! @project.visit! @@ -53,6 +49,12 @@ module QA page.await_installed(:ingress) if @install_ingress page.await_installed(:prometheus) if @install_prometheus page.await_installed(:runner) if @install_runner + + if @install_ingress + populate(:ingress_ip) + page.set_domain("#{ingress_ip}.nip.io") + page.save_domain + end end end end diff --git a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb index 8cd353fa250..13e1a8bc38e 100644 --- a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb +++ b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb @@ -40,7 +40,7 @@ module QA # Create and connect K8s cluster @cluster = Service::KubernetesCluster.new(rbac: rbac).create! - kubernetes_cluster = Resource::KubernetesCluster.fabricate! do |cluster| + Resource::KubernetesCluster.fabricate! do |cluster| cluster.project = @project cluster.cluster = @cluster cluster.install_helm_tiller = true @@ -49,14 +49,11 @@ module QA cluster.install_runner = true end - kubernetes_cluster.populate(:ingress_ip) @project.visit! Page::Project::Menu.perform(&:click_ci_cd_settings) Page::Project::Settings::CICD.perform do |p| p.enable_auto_devops end - - kubernetes_cluster.populate(:domain) end after(:all) do |