diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2016-12-20 13:22:31 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2016-12-20 13:22:31 +0000 |
commit | 4b9bd188433d77fbaec8ae445716de8084b6a145 (patch) | |
tree | 037551cb712b0e917e7f7e6d715dd8e2a1546255 /spec/features/projects | |
parent | dd5965a15ad3fcb0f411b25e2079ef20f311e446 (diff) | |
download | gitlab-ce-4b9bd188433d77fbaec8ae445716de8084b6a145.tar.gz |
Adds tests for the mini pipeline graph
Diffstat (limited to 'spec/features/projects')
-rw-r--r-- | spec/features/projects/pipelines/pipelines_spec.rb | 50 |
1 files changed, 47 insertions, 3 deletions
diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb index 24e501b0151..d1ebb12715f 100644 --- a/spec/features/projects/pipelines/pipelines_spec.rb +++ b/spec/features/projects/pipelines/pipelines_spec.rb @@ -1,7 +1,8 @@ require 'spec_helper' -describe "Pipelines" do +describe "Pipelines", feature: true, js:true do include GitlabRoutingHelper + include WaitForAjax let(:project) { create(:empty_project) } let(:user) { create(:user) } @@ -76,7 +77,11 @@ describe "Pipelines" do it { expect(page).to have_link('Manual build') } context 'when playing' do - before { click_link('Manual build') } + + before do + find('.js-pipeline-dropdown-manual-actions').click + click_link('Manual build') + end it { expect(manual.reload).to be_pending } end @@ -131,7 +136,10 @@ describe "Pipelines" do before { visit namespace_project_pipelines_path(project.namespace, project) } it { expect(page).to have_selector('.build-artifacts') } - it { expect(page).to have_link(with_artifacts.name) } + it do + find('.js-pipeline-dropdown-download').click + expect(page).to have_link(with_artifacts.name) + end end context 'with artifacts expired' do @@ -150,6 +158,42 @@ describe "Pipelines" do it { expect(page).not_to have_selector('.build-artifacts') } end end + + context 'mini pipleine graph' do + let!(:build) do + create(:ci_build, pipeline: pipeline, stage: 'build', name: 'build') + end + + before do + visit namespace_project_pipelines_path(project.namespace, project) + end + + it 'should render a mini pipeline graph' do + endpoint = stage_namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline, stage: build.name) + + expect(page).to have_selector('.mini-pipeline-graph') + expect(page).to have_selector(".js-builds-dropdown-button[data-stage-endpoint='#{endpoint}']") + end + + context 'when clicking a graph stage' do + it 'should open a dropdown' do + find('.js-builds-dropdown-button').trigger('click') + + wait_for_ajax + + expect(page).to have_link build.name + end + + it 'should be possible to retry the failed build' do + find('.js-builds-dropdown-button').trigger('click') + + wait_for_ajax + + find('a.ci-action-icon-container').trigger('click') + expect(page).not_to have_content('Cancel running') + end + end + end end describe 'GET /:project/pipelines/stage.json?name=stage' do |