Commit 290f8899 authored by Dan Davison's avatar Dan Davison

Merge branch 'jsl-fix-perf-bar-take-3' into 'master'

Check for minimal count of performance bar metrics

Closes #197135

See merge request gitlab-org/gitlab!23270
parents 7713bbb5 4b777db1
......@@ -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