Commit 5e943fd1 authored by Jennifer Louie's avatar Jennifer Louie Committed by Dan Davison

Add missing argument to page object method

Add count argument to has_detailed_specs method
Refactor performance_bar_spec
parent 966d7eb3
...@@ -21,7 +21,7 @@ module QA ...@@ -21,7 +21,7 @@ module QA
has_element?(:performance_bar) has_element?(:performance_bar)
end end
def has_detailed_metrics? def has_detailed_metrics?(count)
retry_until(sleep_interval: 1) do retry_until(sleep_interval: 1) do
all_elements(:detailed_metric_content, count: count).all? do |metric| all_elements(:detailed_metric_content, count: count).all? do |metric|
metric.has_text?(%r{\d+}) metric.has_text?(%r{\d+})
......
# frozen_string_literal: true # frozen_string_literal: true
module QA module QA
context 'Performance bar' do context 'Non-devops' do
context 'when logged in as an admin user', :requires_admin, quarantine: 'https://gitlab.com/gitlab-org/gitlab/issues/196141' do describe 'Performance bar display', :requires_admin, quarantine: 'https://gitlab.com/gitlab-org/gitlab/issues/196141' do
context 'when logged in as an admin user' do
# 4 metrics: pg, gitaly, redis, total
let(:metrics_count) { 4 }
before do before do
Flow::Login.sign_in_as_admin Flow::Login.sign_in_as_admin
Page::Main::Menu.perform(&:go_to_admin_area) Page::Main::Menu.perform(&:go_to_admin_area)
...@@ -24,10 +28,11 @@ module QA ...@@ -24,10 +28,11 @@ module QA
Page::Layout::PerformanceBar.perform do |bar_component| Page::Layout::PerformanceBar.perform do |bar_component|
expect(bar_component).to have_performance_bar expect(bar_component).to have_performance_bar
expect(bar_component).to have_detailed_metrics(4) expect(bar_component).to have_detailed_metrics(metrics_count)
expect(bar_component).to have_request_for('realtime_changes') # Always requested on issue pages expect(bar_component).to have_request_for('realtime_changes') # Always requested on issue pages
end end
end end
end end
end end
end
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