Commit 81811623 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'fix_more_decomposed_hanging_specs' into 'master'

Fix hanging specs when decomposed

See merge request gitlab-org/gitlab!82981
parents fd765430 3d2f580c
...@@ -18,7 +18,6 @@ RSpec.describe 'Environment > Metrics' do ...@@ -18,7 +18,6 @@ RSpec.describe 'Environment > Metrics' do
stub_any_prometheus_request stub_any_prometheus_request
sign_in(user) sign_in(user)
visit_environment(environment)
end end
around do |example| around do |example|
...@@ -27,6 +26,7 @@ RSpec.describe 'Environment > Metrics' do ...@@ -27,6 +26,7 @@ RSpec.describe 'Environment > Metrics' do
shared_examples 'has environment selector' do shared_examples 'has environment selector' do
it 'has a working environment selector', :js do it 'has a working environment selector', :js do
visit_environment(environment)
click_link 'Monitoring' click_link 'Monitoring'
expect(page).to have_current_path(project_metrics_dashboard_path(project, environment: environment.id)) expect(page).to have_current_path(project_metrics_dashboard_path(project, environment: environment.id))
...@@ -56,6 +56,7 @@ RSpec.describe 'Environment > Metrics' do ...@@ -56,6 +56,7 @@ RSpec.describe 'Environment > Metrics' do
end end
it 'shows metrics', :js do it 'shows metrics', :js do
visit_environment(environment)
click_link 'Monitoring' click_link 'Monitoring'
expect(page).to have_css('[data-qa-selector="prometheus_graphs"]') # rubocop:disable QA/SelectorUsage expect(page).to have_css('[data-qa-selector="prometheus_graphs"]') # rubocop:disable QA/SelectorUsage
......
...@@ -15,11 +15,10 @@ RSpec.describe 'User browses a job', :js do ...@@ -15,11 +15,10 @@ RSpec.describe 'User browses a job', :js do
stub_feature_flags(bootstrap_confirmation_modals: false) stub_feature_flags(bootstrap_confirmation_modals: false)
sign_in(user) sign_in(user)
visit(project_job_path(project, build))
end end
it 'erases the job log', :js do it 'erases the job log', :js do
visit(project_job_path(project, build))
wait_for_requests wait_for_requests
expect(page).to have_content("Job #{build.name}") expect(page).to have_content("Job #{build.name}")
...@@ -41,6 +40,7 @@ RSpec.describe 'User browses a job', :js do ...@@ -41,6 +40,7 @@ RSpec.describe 'User browses a job', :js do
let!(:build) { create(:ci_build, :success, :unarchived_trace_artifact, :coverage, pipeline: pipeline) } let!(:build) { create(:ci_build, :success, :unarchived_trace_artifact, :coverage, pipeline: pipeline) }
it 'shows no trace message', :js do it 'shows no trace message', :js do
visit(project_job_path(project, build))
wait_for_requests wait_for_requests
expect(page).to have_content('This job does not have a trace.') expect(page).to have_content('This job does not have a trace.')
...@@ -51,6 +51,7 @@ RSpec.describe 'User browses a job', :js do ...@@ -51,6 +51,7 @@ RSpec.describe 'User browses a job', :js do
let!(:build) { create(:ci_build, :failed, :trace_live, pipeline: pipeline) } let!(:build) { create(:ci_build, :failed, :trace_live, pipeline: pipeline) }
it 'displays the failure reason' do it 'displays the failure reason' do
visit(project_job_path(project, build))
wait_for_all_requests wait_for_all_requests
within('.builds-container') do within('.builds-container') do
expect(page).to have_selector( expect(page).to have_selector(
...@@ -62,6 +63,7 @@ RSpec.describe 'User browses a job', :js do ...@@ -62,6 +63,7 @@ RSpec.describe 'User browses a job', :js do
let!(:artifact) { create(:ci_job_artifact, :unarchived_trace_artifact, job: build) } let!(:artifact) { create(:ci_job_artifact, :unarchived_trace_artifact, job: build) }
it 'displays the failure reason from the live trace' do it 'displays the failure reason from the live trace' do
visit(project_job_path(project, build))
wait_for_all_requests wait_for_all_requests
within('.builds-container') do within('.builds-container') do
expect(page).to have_selector( expect(page).to have_selector(
...@@ -75,6 +77,7 @@ RSpec.describe 'User browses a job', :js do ...@@ -75,6 +77,7 @@ RSpec.describe 'User browses a job', :js do
let!(:build_retried) { create(:ci_build, :failed, :retried, :trace_artifact, pipeline: pipeline) } let!(:build_retried) { create(:ci_build, :failed, :retried, :trace_artifact, pipeline: pipeline) }
it 'displays the failure reason and retried label' do it 'displays the failure reason and retried label' do
visit(project_job_path(project, build))
wait_for_all_requests wait_for_all_requests
within('.builds-container') do within('.builds-container') do
expect(page).to have_selector( expect(page).to have_selector(
......
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