summaryrefslogtreecommitdiff
path: root/spec/features/projects/pipelines/pipeline_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects/pipelines/pipeline_spec.rb')
-rw-r--r--spec/features/projects/pipelines/pipeline_spec.rb72
1 files changed, 18 insertions, 54 deletions
diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb
index 2ca584ab8f6..26c46190e7d 100644
--- a/spec/features/projects/pipelines/pipeline_spec.rb
+++ b/spec/features/projects/pipelines/pipeline_spec.rb
@@ -137,6 +137,7 @@ RSpec.describe 'Pipeline', :js do
source_project: project,
source_branch: pipeline.ref)
end
+
let!(:merge_request2) do
create(:merge_request,
source_project: project,
@@ -363,66 +364,29 @@ RSpec.describe 'Pipeline', :js do
describe 'test tabs' do
let(:pipeline) { create(:ci_pipeline, :with_test_reports, :with_report_results, project: project) }
- context 'with build_report_summary feature flag disabled' do
- before do
- stub_feature_flags(build_report_summary: false)
- visit_pipeline
- wait_for_requests
- end
-
- context 'with test reports' do
- it 'shows badge counter in Tests tab' do
- expect(pipeline.test_reports.total_count).to eq(4)
- expect(page.find('.js-test-report-badge-counter').text).to eq(pipeline.test_reports.total_count.to_s)
- end
-
- it 'does not call test_report.json endpoint by default', :js do
- expect(page).to have_selector('.js-no-tests-to-show', visible: :all)
- end
-
- it 'does call test_report.json endpoint when tab is selected', :js do
- find('.js-tests-tab-link').click
- wait_for_requests
-
- expect(page).to have_content('Jobs')
- expect(page).to have_selector('.js-tests-detail', visible: :all)
- end
- end
-
- context 'without test reports' do
- let(:pipeline) { create(:ci_pipeline, project: project) }
-
- it 'shows zero' do
- expect(page.find('.js-test-report-badge-counter', visible: :all).text).to eq("0")
- end
- end
+ before do
+ visit_pipeline
+ wait_for_requests
end
- context 'with build_report_summary feature flag enabled' do
- before do
- visit_pipeline
- wait_for_requests
+ context 'with test reports' do
+ it 'shows badge counter in Tests tab' do
+ expect(page.find('.js-test-report-badge-counter').text).to eq(pipeline.test_report_summary.total[:count].to_s)
end
- context 'with test reports' do
- it 'shows badge counter in Tests tab' do
- expect(page.find('.js-test-report-badge-counter').text).to eq(pipeline.test_report_summary.total_count.to_s)
- end
-
- it 'calls summary.json endpoint', :js do
- find('.js-tests-tab-link').click
+ it 'calls summary.json endpoint', :js do
+ find('.js-tests-tab-link').click
- expect(page).to have_content('Jobs')
- expect(page).to have_selector('.js-tests-detail', visible: :all)
- end
+ expect(page).to have_content('Jobs')
+ expect(page).to have_selector('.js-tests-detail', visible: :all)
end
+ end
- context 'without test reports' do
- let(:pipeline) { create(:ci_pipeline, project: project) }
+ context 'without test reports' do
+ let(:pipeline) { create(:ci_pipeline, project: project) }
- it 'shows zero' do
- expect(page.find('.js-test-report-badge-counter', visible: :all).text).to eq("0")
- end
+ it 'shows zero' do
+ expect(page.find('.js-test-report-badge-counter', visible: :all).text).to eq("0")
end
end
end
@@ -436,7 +400,7 @@ RSpec.describe 'Pipeline', :js do
context 'when retrying' do
before do
- find('.js-retry-button').click
+ find('[data-testid="retryButton"]').click
end
it 'does not show a "Retry" button', :sidekiq_might_not_need_inline do
@@ -938,7 +902,7 @@ RSpec.describe 'Pipeline', :js do
context 'when retrying' do
before do
- find('.js-retry-button').click
+ find('[data-testid="retryButton"]').click
end
it 'does not show a "Retry" button', :sidekiq_might_not_need_inline do