diff options
author | Robert Speicher <rspeicher@gmail.com> | 2019-04-01 17:56:02 +0000 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2019-04-01 17:56:02 +0000 |
commit | 6e240c426258ee17921b1dd6afacdf4dc0bfdb33 (patch) | |
tree | 176adec8827080f546fd3afcfbeb04c4f9df6d54 | |
parent | a027205699c89c7e82fe34db1ec2a0762fb40ddd (diff) | |
parent | 374d4f17442f9d1f159215e3e4887797620f77de (diff) | |
download | gitlab-ce-6e240c426258ee17921b1dd6afacdf4dc0bfdb33.tar.gz |
Merge branch 'bvl-pipeline-spec-broken-master' into 'master'
Refactor the pipeline feature spec
Closes #59747
See merge request gitlab-org/gitlab-ce!26822
-rw-r--r-- | spec/features/projects/pipelines/pipeline_spec.rb | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index 9fdf78baa1e..b197557039d 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -59,11 +59,11 @@ describe 'Pipeline', :js do let(:project) { create(:project, :repository) } let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id, user: user) } - before do - visit project_pipeline_path(project, pipeline) - end + subject(:visit_pipeline) { visit project_pipeline_path(project, pipeline) } it 'shows the pipeline graph' do + visit_pipeline + expect(page).to have_selector('.pipeline-visualization') expect(page).to have_content('Build') expect(page).to have_content('Test') @@ -73,14 +73,20 @@ describe 'Pipeline', :js do end it 'shows Pipeline tab pane as active' do + visit_pipeline + expect(page).to have_css('#js-tab-pipeline.active') end it 'shows link to the pipeline ref' do + visit_pipeline + expect(page).to have_link(pipeline.ref) end it 'shows the pipeline information' do + visit_pipeline + within '.pipeline-info' do expect(page).to have_content("#{pipeline.statuses.count} jobs " \ "for #{pipeline.ref} ") @@ -96,6 +102,10 @@ describe 'Pipeline', :js do end describe 'pipeline graph' do + before do + visit_pipeline + end + context 'when pipeline has running builds' do it 'shows a running icon and a cancel action for the running build' do page.within('#ci-badge-deploy') do @@ -227,6 +237,10 @@ describe 'Pipeline', :js do end context 'page tabs' do + before do + visit_pipeline + end + it 'shows Pipeline, Jobs and Failed Jobs tabs with link' do expect(page).to have_link('Pipeline') expect(page).to have_link('Jobs') @@ -253,6 +267,10 @@ describe 'Pipeline', :js do end context 'retrying jobs' do + before do + visit_pipeline + end + it { expect(page).not_to have_content('retried') } context 'when retrying' do @@ -265,6 +283,10 @@ describe 'Pipeline', :js do end context 'canceling jobs' do + before do + visit_pipeline + end + it { expect(page).not_to have_selector('.ci-canceled') } context 'when canceling' do @@ -284,6 +306,10 @@ describe 'Pipeline', :js do user: user) end + before do + visit_pipeline + end + it 'does not render link to the pipeline ref' do expect(page).not_to have_link(pipeline.ref) expect(page).to have_content(pipeline.ref) @@ -305,6 +331,10 @@ describe 'Pipeline', :js do merge_request.all_pipelines.last end + before do + visit_pipeline + end + it 'shows the pipeline information' do within '.pipeline-info' do expect(page).to have_content("#{pipeline.statuses.count} jobs " \ @@ -356,6 +386,8 @@ describe 'Pipeline', :js do before do pipeline.update(user: user) + + visit_pipeline end it 'shows the pipeline information' do |