diff options
Diffstat (limited to 'qa/qa/page/project/operations/metrics/show.rb')
-rw-r--r-- | qa/qa/page/project/operations/metrics/show.rb | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/qa/qa/page/project/operations/metrics/show.rb b/qa/qa/page/project/operations/metrics/show.rb new file mode 100644 index 00000000000..c94c1f6590f --- /dev/null +++ b/qa/qa/page/project/operations/metrics/show.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module QA + module Page + module Project + module Operations + module Metrics + class Show < Page::Base + EXPECTED_TITLE = 'Memory Usage (Total)' + LOADING_MESSAGE = 'Waiting for performance data' + + view 'app/assets/javascripts/monitoring/components/dashboard.vue' do + element :prometheus_graphs + end + + view 'app/assets/javascripts/monitoring/components/panel_type.vue' do + element :prometheus_graph_widgets + element :prometheus_widgets_dropdown + element :alert_widget_menu_item + end + + def wait_for_metrics + wait_for_data + return if has_metrics? + + wait_until(max_duration: 180) do + wait_for_data + has_metrics? + end + end + + def has_metrics? + within_element :prometheus_graphs do + has_text?(EXPECTED_TITLE) + end + end + + private + + def wait_for_data + wait_until(reload: false) { !has_text?(LOADING_MESSAGE) } if has_text?(LOADING_MESSAGE) + end + end + end + end + end + end +end + +QA::Page::Project::Operations::Metrics::Show.prepend_if_ee('QA::EE::Page::Project::Operations::Metrics::Show') |