Commit 6957cffc authored by svistas's avatar svistas Committed by Jose Vargas

Move test logic for health graphs

Prior to this change, there was
a need for a page to validate the cluster health for ee.
This change deletes the page since cluster health is now
a core functionality and moves
the associated test to the
correct spec file
parent 94c53bcf
...@@ -135,10 +135,6 @@ module QA ...@@ -135,10 +135,6 @@ module QA
end end
module Operations module Operations
module Kubernetes
autoload :Show, 'qa/ee/page/project/operations/kubernetes/show'
end
module Metrics module Metrics
autoload :Show, 'qa/ee/page/project/operations/metrics/show' autoload :Show, 'qa/ee/page/project/operations/metrics/show'
end end
......
# frozen_string_literal: true
module QA
module Page
module Project
module Operations
module Kubernetes
module Show
extend QA::Page::PageConcern
def self.prepended(base)
super
base.class_eval do
view 'app/views/clusters/clusters/_health.html.haml' do
element :cluster_health_section
end
view 'app/views/clusters/clusters/_health_tab.html.haml' do
element :health, required: true
end
end
end
def wait_for_cluster_health
wait_until(max_duration: 120, sleep_interval: 3, reload: true) do
has_cluster_health_graphs?
end
end
def open_health
has_element?(:health, wait: 30)
click_element :health
end
def has_cluster_health_graphs?
within_cluster_health_section do
has_text?('CPU Usage')
end
end
def within_cluster_health_section
within_element :cluster_health_section do
yield
end
end
end
end
end
end
end
end
...@@ -29,6 +29,14 @@ module QA ...@@ -29,6 +29,14 @@ module QA
element :uninstall_button element :uninstall_button
end end
view 'app/views/clusters/clusters/_health.html.haml' do
element :cluster_health_section
end
view 'app/views/clusters/clusters/_health_tab.html.haml' do
element :health, required: true
end
def open_details def open_details
has_element?(:details, wait: 30) has_element?(:details, wait: 30)
click_element :details click_element :details
...@@ -71,11 +79,32 @@ module QA ...@@ -71,11 +79,32 @@ module QA
def save_domain def save_domain
click_element :save_changes_button, Page::Project::Operations::Kubernetes::Show click_element :save_changes_button, Page::Project::Operations::Kubernetes::Show
end end
def wait_for_cluster_health
wait_until(max_duration: 120, sleep_interval: 3, reload: true) do
has_cluster_health_graphs?
end
end
def open_health
has_element?(:health, wait: 30)
click_element :health
end
def has_cluster_health_graphs?
within_cluster_health_section do
has_text?('CPU Usage')
end
end
def within_cluster_health_section
within_element :cluster_health_section do
yield
end
end
end end
end end
end end
end end
end end
end end
QA::Page::Project::Operations::Kubernetes::Show.prepend_if_ee('QA::EE::Page::Project::Operations::Kubernetes::Show')
...@@ -64,6 +64,19 @@ module QA ...@@ -64,6 +64,19 @@ module QA
end end
end end
it 'observes cluster health graph' do
Page::Project::Menu.perform(&:go_to_operations_kubernetes)
Page::Project::Operations::Kubernetes::Index.perform do |cluster_list|
cluster_list.click_on_cluster(@cluster)
end
Page::Project::Operations::Kubernetes::Show.perform do |cluster_panel|
cluster_panel.open_health
cluster_panel.wait_for_cluster_health
end
end
private private
def deploy_project_with_prometheus def deploy_project_with_prometheus
......
...@@ -35,19 +35,6 @@ module QA ...@@ -35,19 +35,6 @@ module QA
end end
end end
it 'observes cluster health graph' do
Page::Project::Menu.perform(&:go_to_operations_kubernetes)
Page::Project::Operations::Kubernetes::Index.perform do |cluster_list|
cluster_list.click_on_cluster(@cluster)
end
Page::Project::Operations::Kubernetes::Show.perform do |cluster_panel|
cluster_panel.open_health
cluster_panel.wait_for_cluster_health
end
end
it 'creates and sets an incident template' do it 'creates and sets an incident template' do
create_incident_template create_incident_template
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment