Commit 4b777db1 authored by Jennie Louie's avatar Jennie Louie

Check for minimal count of performance bar metrics

parent c9c86caa
......@@ -21,9 +21,9 @@ module QA
has_element?(:performance_bar)
end
def has_detailed_metrics?(count)
def has_detailed_metrics?(minimum_count)
retry_until(sleep_interval: 1) do
all_elements(:detailed_metric_content, count: count).all? do |metric|
all_elements(:detailed_metric_content, minimum: minimum_count).all? do |metric|
metric.has_text?(%r{\d+})
end
end
......
......@@ -4,8 +4,8 @@ module QA
context 'Non-devops' do
describe 'Performance bar display', :requires_admin do
context 'when logged in as an admin user' do
# 4 metrics: pg, gitaly, redis, total
let(:metrics_count) { 4 }
# performance metrics: pg, gitaly, redis, rugged (feature flagged), total (not always provided)
let(:minimum_metrics_count) { 3 }
before do
Flow::Login.sign_in_as_admin
......@@ -28,7 +28,7 @@ module QA
Page::Layout::PerformanceBar.perform do |bar_component|
expect(bar_component).to have_performance_bar
expect(bar_component).to have_detailed_metrics(metrics_count)
expect(bar_component).to have_detailed_metrics(minimum_metrics_count)
expect(bar_component).to have_request_for('realtime_changes') # Always requested on issue pages
end
end
......
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