diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /spec/features/projects | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'spec/features/projects')
258 files changed, 606 insertions, 2762 deletions
diff --git a/spec/features/projects/active_tabs_spec.rb b/spec/features/projects/active_tabs_spec.rb index ff97d3c9503..c27c9530f61 100644 --- a/spec/features/projects/active_tabs_spec.rb +++ b/spec/features/projects/active_tabs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project active tab' do +RSpec.describe 'Project active tab', feature_category: :projects do let_it_be(:project) { create(:project, :repository, :with_namespace_settings) } let(:user) { project.first_owner } diff --git a/spec/features/projects/activity/rss_spec.rb b/spec/features/projects/activity/rss_spec.rb index a3e511b5c22..5297f30220d 100644 --- a/spec/features/projects/activity/rss_spec.rb +++ b/spec/features/projects/activity/rss_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project Activity RSS' do +RSpec.describe 'Project Activity RSS', feature_category: :projects do let(:project) { create(:project, :public) } let(:user) { project.first_owner } let(:path) { activity_project_path(project) } diff --git a/spec/features/projects/activity/user_sees_activity_spec.rb b/spec/features/projects/activity/user_sees_activity_spec.rb index a9cdbd5c342..cfa62415c49 100644 --- a/spec/features/projects/activity/user_sees_activity_spec.rb +++ b/spec/features/projects/activity/user_sees_activity_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Activity > User sees activity' do +RSpec.describe 'Projects > Activity > User sees activity', feature_category: :projects do let(:project) { create(:project, :repository, :public) } let(:user) { project.creator } let(:issue) { create(:issue, project: project) } diff --git a/spec/features/projects/activity/user_sees_design_activity_spec.rb b/spec/features/projects/activity/user_sees_design_activity_spec.rb index 70153921b82..6a51e548700 100644 --- a/spec/features/projects/activity/user_sees_design_activity_spec.rb +++ b/spec/features/projects/activity/user_sees_design_activity_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Activity > User sees design Activity', :js do +RSpec.describe 'Projects > Activity > User sees design Activity', :js, feature_category: :design_management do include DesignManagementTestHelpers let_it_be(:uploader) { create(:user) } diff --git a/spec/features/projects/activity/user_sees_design_comment_spec.rb b/spec/features/projects/activity/user_sees_design_comment_spec.rb index 3a8e2790858..2d333e55b13 100644 --- a/spec/features/projects/activity/user_sees_design_comment_spec.rb +++ b/spec/features/projects/activity/user_sees_design_comment_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Activity > User sees design comment', :js do +RSpec.describe 'Projects > Activity > User sees design comment', :js, feature_category: :design_management do include DesignManagementTestHelpers let_it_be(:project) { create(:project, :repository, :public) } diff --git a/spec/features/projects/activity/user_sees_private_activity_spec.rb b/spec/features/projects/activity/user_sees_private_activity_spec.rb index 86692bc6b4c..e0aaf1dbbc3 100644 --- a/spec/features/projects/activity/user_sees_private_activity_spec.rb +++ b/spec/features/projects/activity/user_sees_private_activity_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project > Activity > User sees private activity', :js do +RSpec.describe 'Project > Activity > User sees private activity', :js, feature_category: :projects do let(:project) { create(:project, :public) } let(:author) { create(:user) } let(:user) { create(:user) } diff --git a/spec/features/projects/artifacts/file_spec.rb b/spec/features/projects/artifacts/file_spec.rb index f97c1b0e543..fe38cbc70f1 100644 --- a/spec/features/projects/artifacts/file_spec.rb +++ b/spec/features/projects/artifacts/file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Artifact file', :js do +RSpec.describe 'Artifact file', :js, feature_category: :build_artifacts do let(:project) { create(:project, :public) } let(:pipeline) { create(:ci_empty_pipeline, project: project) } let(:build) { create(:ci_build, :artifacts, pipeline: pipeline) } diff --git a/spec/features/projects/artifacts/raw_spec.rb b/spec/features/projects/artifacts/raw_spec.rb index c10cb56a44b..544875d36e3 100644 --- a/spec/features/projects/artifacts/raw_spec.rb +++ b/spec/features/projects/artifacts/raw_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Raw artifact' do +RSpec.describe 'Raw artifact', feature_category: :build_artifacts do let(:project) { create(:project, :public) } let(:pipeline) { create(:ci_empty_pipeline, project: project) } let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) } diff --git a/spec/features/projects/artifacts/user_browses_artifacts_spec.rb b/spec/features/projects/artifacts/user_browses_artifacts_spec.rb index c0d710fe186..6948a26196b 100644 --- a/spec/features/projects/artifacts/user_browses_artifacts_spec.rb +++ b/spec/features/projects/artifacts/user_browses_artifacts_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe "User browses artifacts" do +RSpec.describe "User browses artifacts", feature_category: :build_artifacts do let(:project) { create(:project, :public) } let(:pipeline) { create(:ci_empty_pipeline, project: project) } let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) } diff --git a/spec/features/projects/artifacts/user_downloads_artifacts_spec.rb b/spec/features/projects/artifacts/user_downloads_artifacts_spec.rb index 7d6ae03e08e..48dcb95e09b 100644 --- a/spec/features/projects/artifacts/user_downloads_artifacts_spec.rb +++ b/spec/features/projects/artifacts/user_downloads_artifacts_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe "User downloads artifacts" do +RSpec.describe "User downloads artifacts", feature_category: :build_artifacts do let_it_be(:project) { create(:project, :repository, :public) } let_it_be(:pipeline) { create(:ci_empty_pipeline, status: :success, sha: project.commit.id, project: project) } let_it_be(:job) { create(:ci_build, :artifacts, :success, pipeline: pipeline) } diff --git a/spec/features/projects/badges/coverage_spec.rb b/spec/features/projects/badges/coverage_spec.rb index 7555e567c37..3c8b17607ca 100644 --- a/spec/features/projects/badges/coverage_spec.rb +++ b/spec/features/projects/badges/coverage_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'test coverage badge' do +RSpec.describe 'test coverage badge', feature_category: :code_testing do let!(:user) { create(:user) } let!(:project) { create(:project, :private) } diff --git a/spec/features/projects/badges/list_spec.rb b/spec/features/projects/badges/list_spec.rb index d1e635f11c0..e6bd4b22b0a 100644 --- a/spec/features/projects/badges/list_spec.rb +++ b/spec/features/projects/badges/list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'list of badges' do +RSpec.describe 'list of badges', feature_category: :continuous_integration do before do user = create(:user) project = create(:project, :repository) diff --git a/spec/features/projects/badges/pipeline_badge_spec.rb b/spec/features/projects/badges/pipeline_badge_spec.rb index e3a01ab6fa2..c0f5d0ffead 100644 --- a/spec/features/projects/badges/pipeline_badge_spec.rb +++ b/spec/features/projects/badges/pipeline_badge_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Pipeline Badge' do +RSpec.describe 'Pipeline Badge', feature_category: :continuous_integration do let_it_be(:project) { create(:project, :repository, :public) } let(:ref) { project.default_branch } diff --git a/spec/features/projects/blobs/blame_spec.rb b/spec/features/projects/blobs/blame_spec.rb index 5287d5e4f7d..27b7c6ef2d5 100644 --- a/spec/features/projects/blobs/blame_spec.rb +++ b/spec/features/projects/blobs/blame_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'File blame', :js do +RSpec.describe 'File blame', :js, feature_category: :projects do include TreeHelper let_it_be(:project) { create(:project, :public, :repository) } diff --git a/spec/features/projects/blobs/blob_line_permalink_updater_spec.rb b/spec/features/projects/blobs/blob_line_permalink_updater_spec.rb index 9b0edcd09d2..48ee39dad19 100644 --- a/spec/features/projects/blobs/blob_line_permalink_updater_spec.rb +++ b/spec/features/projects/blobs/blob_line_permalink_updater_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Blob button line permalinks (BlobLinePermalinkUpdater)', :js do +RSpec.describe 'Blob button line permalinks (BlobLinePermalinkUpdater)', :js, feature_category: :projects do include TreeHelper let(:project) { create(:project, :public, :repository) } diff --git a/spec/features/projects/blobs/blob_show_spec.rb b/spec/features/projects/blobs/blob_show_spec.rb index e01382cf31f..b7e0e3fd590 100644 --- a/spec/features/projects/blobs/blob_show_spec.rb +++ b/spec/features/projects/blobs/blob_show_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'File blob', :js do +RSpec.describe 'File blob', :js, feature_category: :projects do include MobileHelpers let(:project) { create(:project, :public, :repository) } @@ -589,76 +589,35 @@ RSpec.describe 'File blob', :js do file_path: '.gitlab/dashboards/custom-dashboard.yml', file_content: file_content ).execute - end - - context 'with metrics_dashboard_exhaustive_validations feature flag off' do - before do - stub_feature_flags(metrics_dashboard_exhaustive_validations: false) - visit_blob('.gitlab/dashboards/custom-dashboard.yml') - end - - context 'valid dashboard file' do - let(:file_content) { File.read(Rails.root.join('config/prometheus/common_metrics.yml')) } - - it 'displays an auxiliary viewer' do - aggregate_failures do - # shows that dashboard yaml is valid - expect(page).to have_content('Metrics Dashboard YAML definition is valid.') - - # shows a learn more link - expect(page).to have_link('Learn more') - end - end - end - - context 'invalid dashboard file' do - let(:file_content) { "dashboard: 'invalid'" } - - it 'displays an auxiliary viewer' do - aggregate_failures do - # shows that dashboard yaml is invalid - expect(page).to have_content('Metrics Dashboard YAML definition is invalid:') - expect(page).to have_content("panel_groups: should be an array of panel_groups objects") - # shows a learn more link - expect(page).to have_link('Learn more') - end - end - end + visit_blob('.gitlab/dashboards/custom-dashboard.yml') end - context 'with metrics_dashboard_exhaustive_validations feature flag on' do - before do - stub_feature_flags(metrics_dashboard_exhaustive_validations: true) - visit_blob('.gitlab/dashboards/custom-dashboard.yml') - end - - context 'valid dashboard file' do - let(:file_content) { File.read(Rails.root.join('config/prometheus/common_metrics.yml')) } + context 'valid dashboard file' do + let(:file_content) { File.read(Rails.root.join('config/prometheus/common_metrics.yml')) } - it 'displays an auxiliary viewer' do - aggregate_failures do - # shows that dashboard yaml is valid - expect(page).to have_content('Metrics Dashboard YAML definition is valid.') + it 'displays an auxiliary viewer' do + aggregate_failures do + # shows that dashboard yaml is valid + expect(page).to have_content('Metrics Dashboard YAML definition is valid.') - # shows a learn more link - expect(page).to have_link('Learn more') - end + # shows a learn more link + expect(page).to have_link('Learn more') end end + end - context 'invalid dashboard file' do - let(:file_content) { "dashboard: 'invalid'" } + context 'invalid dashboard file' do + let(:file_content) { "dashboard: 'invalid'" } - it 'displays an auxiliary viewer' do - aggregate_failures do - # shows that dashboard yaml is invalid - expect(page).to have_content('Metrics Dashboard YAML definition is invalid:') - expect(page).to have_content("root is missing required keys: panel_groups") + it 'displays an auxiliary viewer' do + aggregate_failures do + # shows that dashboard yaml is invalid + expect(page).to have_content('Metrics Dashboard YAML definition is invalid:') + expect(page).to have_content("panel_groups: should be an array of panel_groups objects") - # shows a learn more link - expect(page).to have_link('Learn more') - end + # shows a learn more link + expect(page).to have_link('Learn more') end end end @@ -1002,7 +961,7 @@ RSpec.describe 'File blob', :js do end it 'renders sandboxed iframe' do - expected = %(<iframe src="/-/sandbox/swagger" sandbox="allow-scripts allow-popups" frameborder="0" width="100%" height="1000">) + expected = %(<iframe src="/-/sandbox/swagger" sandbox="allow-scripts allow-popups allow-forms" frameborder="0" width="100%" height="1000">) expect(page.html).to include(expected) end end diff --git a/spec/features/projects/blobs/edit_spec.rb b/spec/features/projects/blobs/edit_spec.rb index 5587b8abab3..144b4ed85cd 100644 --- a/spec/features/projects/blobs/edit_spec.rb +++ b/spec/features/projects/blobs/edit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Editing file blob', :js do +RSpec.describe 'Editing file blob', :js, feature_category: :projects do include Spec::Support::Helpers::Features::SourceEditorSpecHelpers include TreeHelper include BlobSpecHelpers @@ -97,11 +97,16 @@ RSpec.describe 'Editing file blob', :js do "Add a table" ] - before do + it "does not have any buttons" do + stub_feature_flags(source_editor_toolbar: true) visit project_edit_blob_path(project, tree_join(branch, readme_file_path)) + buttons = page.all('.file-buttons .md-header-toolbar button[type="button"]') + expect(buttons.length).to eq(0) end - it "has defined set of toolbar buttons" do + it "has defined set of toolbar buttons when the flag is off" do + stub_feature_flags(source_editor_toolbar: false) + visit project_edit_blob_path(project, tree_join(branch, readme_file_path)) buttons = page.all('.file-buttons .md-header-toolbar button[type="button"]') expect(buttons.length).to eq(toolbar_buttons.length) toolbar_buttons.each_with_index do |button_title, i| diff --git a/spec/features/projects/blobs/shortcuts_blob_spec.rb b/spec/features/projects/blobs/shortcuts_blob_spec.rb index 64d643aa102..03276a737da 100644 --- a/spec/features/projects/blobs/shortcuts_blob_spec.rb +++ b/spec/features/projects/blobs/shortcuts_blob_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Blob shortcuts', :js do +RSpec.describe 'Blob shortcuts', :js, feature_category: :projects do include TreeHelper let(:project) { create(:project, :public, :repository) } let(:path) { project.repository.ls_files(project.repository.root_ref)[0] } diff --git a/spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb b/spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb index a2db5e11c7c..a497be4cbc3 100644 --- a/spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb +++ b/spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User follows pipeline suggest nudge spec when feature is enabled', :js do +RSpec.describe 'User follows pipeline suggest nudge spec when feature is enabled', :js, feature_category: :projects do include CookieHelper let(:project) { create(:project, :empty_repo) } diff --git a/spec/features/projects/blobs/user_views_pipeline_editor_button_spec.rb b/spec/features/projects/blobs/user_views_pipeline_editor_button_spec.rb index 15e7a495e60..2f67e909543 100644 --- a/spec/features/projects/blobs/user_views_pipeline_editor_button_spec.rb +++ b/spec/features/projects/blobs/user_views_pipeline_editor_button_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User views pipeline editor button on root ci config file', :js do +RSpec.describe 'User views pipeline editor button on root ci config file', :js, feature_category: :projects do include BlobSpecHelpers let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/branches/download_buttons_spec.rb b/spec/features/projects/branches/download_buttons_spec.rb index 569a93a55fc..80ccd9c1417 100644 --- a/spec/features/projects/branches/download_buttons_spec.rb +++ b/spec/features/projects/branches/download_buttons_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Download buttons in branches page' do +RSpec.describe 'Download buttons in branches page', feature_category: :projects do let(:user) { create(:user) } let(:role) { :developer } let(:status) { 'success' } diff --git a/spec/features/projects/branches/new_branch_ref_dropdown_spec.rb b/spec/features/projects/branches/new_branch_ref_dropdown_spec.rb index 5f58e446ed9..eb370cfc1fc 100644 --- a/spec/features/projects/branches/new_branch_ref_dropdown_spec.rb +++ b/spec/features/projects/branches/new_branch_ref_dropdown_spec.rb @@ -2,10 +2,11 @@ require 'spec_helper' -RSpec.describe 'New Branch Ref Dropdown', :js do +RSpec.describe 'New Branch Ref Dropdown', :js, feature_category: :projects do let(:user) { create(:user) } let(:project) { create(:project, :public, :repository) } - let(:toggle) { find('.create-from .dropdown-menu-toggle') } + let(:sha) { project.commit.sha } + let(:toggle) { find('.ref-selector') } before do project.add_maintainer(user) @@ -14,37 +15,75 @@ RSpec.describe 'New Branch Ref Dropdown', :js do visit new_project_branch_path(project) end - it 'filters a list of branches and tags' do + it 'finds a tag in a list' do + tag_name = 'v1.0.0' + toggle.click - filter_by('v1.0.0') + filter_by(tag_name) + + wait_for_requests + + expect(items_count(tag_name)).to be(1) - expect(items_count).to be(1) + item(tag_name).click - filter_by('video') + expect(toggle).to have_content tag_name + end + + it 'finds a branch in a list' do + branch_name = 'audio' - expect(items_count).to be(1) + toggle.click - find('.create-from .dropdown-content li').click + filter_by(branch_name) - expect(toggle).to have_content 'video' + wait_for_requests + + expect(items_count(branch_name)).to be(1) + + item(branch_name).click + + expect(toggle).to have_content branch_name end - it 'accepts a manually entered commit SHA' do + it 'finds a commit in a list' do toggle.click - filter_by('somecommitsha') + filter_by(sha) + + wait_for_requests + + sha_short = sha[0, 7] - find('.create-from input[type=search]').send_keys(:enter) + expect(items_count(sha_short)).to be(1) + + item(sha_short).click + + expect(toggle).to have_content sha_short + end + + it 'shows no results when there is no branch, tag or commit sha found' do + non_existing_ref = 'non_existing_branch_name' + + toggle.click + + filter_by(non_existing_ref) + + wait_for_requests + + expect(find('.gl-dropdown-contents')).not_to have_content(non_existing_ref) + end - expect(toggle).to have_content 'somecommitsha' + def item(ref_name) + find('li', text: ref_name, match: :prefer_exact) end - def items_count - all('.create-from .dropdown-content li').length + def items_count(ref_name) + all('li', text: ref_name, match: :prefer_exact).length end def filter_by(filter_text) - fill_in 'Filter by Git revision', with: filter_text + fill_in _('Search by Git revision'), with: filter_text end end diff --git a/spec/features/projects/branches/user_creates_branch_spec.rb b/spec/features/projects/branches/user_creates_branch_spec.rb index be236b7ca7e..60bd77393e9 100644 --- a/spec/features/projects/branches/user_creates_branch_spec.rb +++ b/spec/features/projects/branches/user_creates_branch_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User creates branch', :js do +RSpec.describe 'User creates branch', :js, feature_category: :projects do include Spec::Support::Helpers::Features::BranchesHelpers let_it_be(:group) { create(:group, :public) } @@ -81,11 +81,7 @@ RSpec.describe 'User creates branch', :js do it 'does not create new branch' do invalid_branch_name = '1.0 stable' - fill_in('branch_name', with: invalid_branch_name) - page.find('body').click # defocus the branch_name input - - select_branch('master') - click_button('Create branch') + create_branch(invalid_branch_name) expect(page).to have_content('Branch name is invalid') expect(page).to have_content("can't contain spaces") diff --git a/spec/features/projects/branches/user_deletes_branch_spec.rb b/spec/features/projects/branches/user_deletes_branch_spec.rb index a89fed3a78a..92b5f176d2d 100644 --- a/spec/features/projects/branches/user_deletes_branch_spec.rb +++ b/spec/features/projects/branches/user_deletes_branch_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe "User deletes branch", :js do +RSpec.describe "User deletes branch", :js, feature_category: :projects do include Spec::Support::Helpers::ModalHelpers let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/branches/user_views_branches_spec.rb b/spec/features/projects/branches/user_views_branches_spec.rb index 3f0614532f1..f0a1ba84ec6 100644 --- a/spec/features/projects/branches/user_views_branches_spec.rb +++ b/spec/features/projects/branches/user_views_branches_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe "User views branches", :js do +RSpec.describe "User views branches", :js, feature_category: :projects do let_it_be(:project) { create(:project, :repository) } let_it_be(:user) { project.first_owner } diff --git a/spec/features/projects/branches_spec.rb b/spec/features/projects/branches_spec.rb index ecf6349e431..fc7833809b3 100644 --- a/spec/features/projects/branches_spec.rb +++ b/spec/features/projects/branches_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Branches' do +RSpec.describe 'Branches', feature_category: :projects do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, :public, :repository) } let(:repository) { project.repository } @@ -143,7 +143,7 @@ RSpec.describe 'Branches' do click_button "Updated date" # Open sorting dropdown within '[data-testid="branches-dropdown"]' do - find('p', text: 'Name').click + first('span', text: 'Name').click end expect(page).to have_content(sorted_branches(repository, count: 20, sort_by: :name)) @@ -154,7 +154,7 @@ RSpec.describe 'Branches' do click_button "Updated date" # Open sorting dropdown within '[data-testid="branches-dropdown"]' do - find('p', text: 'Oldest updated').click + first('span', text: 'Oldest updated').click end expect(page).to have_content(sorted_branches(repository, count: 20, sort_by: :updated_asc)) diff --git a/spec/features/projects/ci/editor_spec.rb b/spec/features/projects/ci/editor_spec.rb index c96d5f5823f..536152626af 100644 --- a/spec/features/projects/ci/editor_spec.rb +++ b/spec/features/projects/ci/editor_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Pipeline Editor', :js do +RSpec.describe 'Pipeline Editor', :js, feature_category: :pipeline_authoring do include Spec::Support::Helpers::Features::SourceEditorSpecHelpers let(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/projects/ci/lint_spec.rb b/spec/features/projects/ci/lint_spec.rb index 8d5f62d8a06..4fea07b18bc 100644 --- a/spec/features/projects/ci/lint_spec.rb +++ b/spec/features/projects/ci/lint_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'CI Lint', :js do +RSpec.describe 'CI Lint', :js, feature_category: :pipeline_authoring do include Spec::Support::Helpers::Features::SourceEditorSpecHelpers let_it_be(:project) { create(:project, :repository) } diff --git a/spec/features/projects/classification_label_on_project_pages_spec.rb b/spec/features/projects/classification_label_on_project_pages_spec.rb index 9522e5ce2cf..662b2296234 100644 --- a/spec/features/projects/classification_label_on_project_pages_spec.rb +++ b/spec/features/projects/classification_label_on_project_pages_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Classification label on project pages' do +RSpec.describe 'Classification label on project pages', feature_category: :projects do let(:project) do create(:project, external_authorization_classification_label: 'authorized label') end diff --git a/spec/features/projects/cluster_agents_spec.rb b/spec/features/projects/cluster_agents_spec.rb index 8c557a9c37a..43046db2b6c 100644 --- a/spec/features/projects/cluster_agents_spec.rb +++ b/spec/features/projects/cluster_agents_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'ClusterAgents', :js do +RSpec.describe 'ClusterAgents', :js, feature_category: :projects do let_it_be(:token) { create(:cluster_agent_token, description: 'feature test token') } let(:agent) { token.agent } diff --git a/spec/features/projects/clusters/gcp_spec.rb b/spec/features/projects/clusters/gcp_spec.rb index 5c54b7fda7c..114182982e2 100644 --- a/spec/features/projects/clusters/gcp_spec.rb +++ b/spec/features/projects/clusters/gcp_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Gcp Cluster', :js do +RSpec.describe 'Gcp Cluster', :js, feature_category: :kubernetes_management do include GoogleApi::CloudPlatformHelpers let(:project) { create(:project) } diff --git a/spec/features/projects/clusters/user_spec.rb b/spec/features/projects/clusters/user_spec.rb index 527d038f975..34fc0a76c7f 100644 --- a/spec/features/projects/clusters/user_spec.rb +++ b/spec/features/projects/clusters/user_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User Cluster', :js do +RSpec.describe 'User Cluster', :js, feature_category: :kubernetes_management do include GoogleApi::CloudPlatformHelpers let(:project) { create(:project) } diff --git a/spec/features/projects/clusters_spec.rb b/spec/features/projects/clusters_spec.rb index 9e1d66bc73e..3fb586bd143 100644 --- a/spec/features/projects/clusters_spec.rb +++ b/spec/features/projects/clusters_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Clusters', :js do +RSpec.describe 'Clusters', :js, feature_category: :projects do include GoogleApi::CloudPlatformHelpers let(:project) { create(:project) } diff --git a/spec/features/projects/commit/builds_spec.rb b/spec/features/projects/commit/builds_spec.rb index 7b10f72006f..dfd58a99953 100644 --- a/spec/features/projects/commit/builds_spec.rb +++ b/spec/features/projects/commit/builds_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'project commit pipelines', :js do +RSpec.describe 'project commit pipelines', :js, feature_category: :continuous_integration do let(:project) { create(:project, :repository) } before do diff --git a/spec/features/projects/commit/cherry_pick_spec.rb b/spec/features/projects/commit/cherry_pick_spec.rb index fce9fa4fb62..dc8b84283a1 100644 --- a/spec/features/projects/commit/cherry_pick_spec.rb +++ b/spec/features/projects/commit/cherry_pick_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Cherry-pick Commits', :js do +RSpec.describe 'Cherry-pick Commits', :js, feature_category: :source_code_management do let_it_be(:user) { create(:user) } let_it_be(:sha) { '7d3b0f7cff5f37573aea97cebfd5692ea1689924' } diff --git a/spec/features/projects/commit/comments/user_adds_comment_spec.rb b/spec/features/projects/commit/comments/user_adds_comment_spec.rb index a470215186b..c53ac27bb5f 100644 --- a/spec/features/projects/commit/comments/user_adds_comment_spec.rb +++ b/spec/features/projects/commit/comments/user_adds_comment_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe "User adds a comment on a commit", :js do +RSpec.describe "User adds a comment on a commit", :js, feature_category: :source_code_management do include Spec::Support::Helpers::Features::NotesHelpers include RepoHelpers diff --git a/spec/features/projects/commit/comments/user_deletes_comments_spec.rb b/spec/features/projects/commit/comments/user_deletes_comments_spec.rb index 9059f9e4857..a1e7ddb4d6e 100644 --- a/spec/features/projects/commit/comments/user_deletes_comments_spec.rb +++ b/spec/features/projects/commit/comments/user_deletes_comments_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe "User deletes comments on a commit", :js do +RSpec.describe "User deletes comments on a commit", :js, feature_category: :source_code_management do include Spec::Support::Helpers::Features::NotesHelpers include Spec::Support::Helpers::ModalHelpers include RepoHelpers diff --git a/spec/features/projects/commit/comments/user_edits_comments_spec.rb b/spec/features/projects/commit/comments/user_edits_comments_spec.rb index 8ac15c9cb7f..9019a981a18 100644 --- a/spec/features/projects/commit/comments/user_edits_comments_spec.rb +++ b/spec/features/projects/commit/comments/user_edits_comments_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe "User edits a comment on a commit", :js do +RSpec.describe "User edits a comment on a commit", :js, feature_category: :source_code_management do include Spec::Support::Helpers::Features::NotesHelpers include RepoHelpers diff --git a/spec/features/projects/commit/diff_notes_spec.rb b/spec/features/projects/commit/diff_notes_spec.rb index 6cebff1cc9a..f29e0803f61 100644 --- a/spec/features/projects/commit/diff_notes_spec.rb +++ b/spec/features/projects/commit/diff_notes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Commit diff', :js do +RSpec.describe 'Commit diff', :js, feature_category: :source_code_management do include RepoHelpers let(:user) { create(:user) } diff --git a/spec/features/projects/commit/mini_pipeline_graph_spec.rb b/spec/features/projects/commit/mini_pipeline_graph_spec.rb index 417e14e2376..3611efd1477 100644 --- a/spec/features/projects/commit/mini_pipeline_graph_spec.rb +++ b/spec/features/projects/commit/mini_pipeline_graph_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Mini Pipeline Graph in Commit View', :js do +RSpec.describe 'Mini Pipeline Graph in Commit View', :js, feature_category: :source_code_management do let(:project) { create(:project, :public, :repository) } context 'when commit has pipelines' do diff --git a/spec/features/projects/commit/user_comments_on_commit_spec.rb b/spec/features/projects/commit/user_comments_on_commit_spec.rb index a7f23f093a3..66a407b5ff6 100644 --- a/spec/features/projects/commit/user_comments_on_commit_spec.rb +++ b/spec/features/projects/commit/user_comments_on_commit_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe "User comments on commit", :js do +RSpec.describe "User comments on commit", :js, feature_category: :source_code_management do include Spec::Support::Helpers::Features::NotesHelpers include Spec::Support::Helpers::ModalHelpers include RepoHelpers diff --git a/spec/features/projects/commit/user_reverts_commit_spec.rb b/spec/features/projects/commit/user_reverts_commit_spec.rb index 1c6cf5eb258..8c7b8e6ba32 100644 --- a/spec/features/projects/commit/user_reverts_commit_spec.rb +++ b/spec/features/projects/commit/user_reverts_commit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User reverts a commit', :js do +RSpec.describe 'User reverts a commit', :js, feature_category: :source_code_management do include RepoHelpers let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/commit/user_views_user_status_on_commit_spec.rb b/spec/features/projects/commit/user_views_user_status_on_commit_spec.rb index cc3c70e66ce..5670ed17eba 100644 --- a/spec/features/projects/commit/user_views_user_status_on_commit_spec.rb +++ b/spec/features/projects/commit/user_views_user_status_on_commit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project > Commit > View user status' do +RSpec.describe 'Project > Commit > View user status', feature_category: :source_code_management do include RepoHelpers let_it_be(:project) { create(:project, :repository) } diff --git a/spec/features/projects/commits/multi_view_diff_spec.rb b/spec/features/projects/commits/multi_view_diff_spec.rb index c0e48b7b86c..b178a1c2171 100644 --- a/spec/features/projects/commits/multi_view_diff_spec.rb +++ b/spec/features/projects/commits/multi_view_diff_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.shared_examples "no multiple viewers" do |commit_ref| +RSpec.shared_examples "no multiple viewers", feature_category: :source_code_management do |commit_ref| let(:ref) { commit_ref } it "does not display multiple diff viewers" do diff --git a/spec/features/projects/commits/rss_spec.rb b/spec/features/projects/commits/rss_spec.rb index b521bb865ae..49da0727fbd 100644 --- a/spec/features/projects/commits/rss_spec.rb +++ b/spec/features/projects/commits/rss_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project Commits RSS' do +RSpec.describe 'Project Commits RSS', feature_category: :source_code_management do let(:user) { create(:user) } let(:project) { create(:project, :repository, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } let(:path) { project_commits_path(project, :master) } diff --git a/spec/features/projects/commits/user_browses_commits_spec.rb b/spec/features/projects/commits/user_browses_commits_spec.rb index 2719316c5dc..791f626b8d9 100644 --- a/spec/features/projects/commits/user_browses_commits_spec.rb +++ b/spec/features/projects/commits/user_browses_commits_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User browses commits' do +RSpec.describe 'User browses commits', feature_category: :source_code_management do include RepoHelpers let(:user) { create(:user) } @@ -208,6 +208,10 @@ RSpec.describe 'User browses commits' do expect(page).not_to have_link 'Create merge request' end + it 'shows ref switcher with correct text', :js do + expect(find('.ref-selector')).to have_text('master') + end + context 'when click the compare tab' do before do wait_for_requests @@ -220,9 +224,18 @@ RSpec.describe 'User browses commits' do end end - context 'feature branch' do + context 'feature branch', :js do let(:visit_commits_page) do - visit project_commits_path(project, 'feature') + visit project_commits_path(project) + + find('.ref-selector').click + wait_for_requests + + page.within('.ref-selector') do + fill_in 'Search by Git revision', with: 'feature' + wait_for_requests + find('li', text: 'feature', match: :prefer_exact).click + end end context 'when project does not have open merge requests' do @@ -230,6 +243,10 @@ RSpec.describe 'User browses commits' do visit_commits_page end + it 'shows ref switcher with correct text' do + expect(find('.ref-selector')).to have_text('feature') + end + it 'renders project commits' do commit = project.repository.commit('0b4bc9a') diff --git a/spec/features/projects/compare_spec.rb b/spec/features/projects/compare_spec.rb index 22b0f344606..8284299443f 100644 --- a/spec/features/projects/compare_spec.rb +++ b/spec/features/projects/compare_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe "Compare", :js do +RSpec.describe "Compare", :js, feature_category: :projects do let(:user) { create(:user) } let(:project) { create(:project, :repository) } @@ -17,10 +17,10 @@ RSpec.describe "Compare", :js do visit project_compare_index_path(project, from: 'master', to: 'master') select_using_dropdown 'from', 'feature' - expect(find('.js-compare-from-dropdown .gl-new-dropdown-button-text')).to have_content('feature') + expect(find('.js-compare-from-dropdown .gl-dropdown-button-text')).to have_content('feature') select_using_dropdown 'to', 'binary-encoding' - expect(find('.js-compare-to-dropdown .gl-new-dropdown-button-text')).to have_content('binary-encoding') + expect(find('.js-compare-to-dropdown .gl-dropdown-button-text')).to have_content('binary-encoding') click_button 'Compare' @@ -32,8 +32,8 @@ RSpec.describe "Compare", :js do it "pre-populates fields" do visit project_compare_index_path(project, from: "master", to: "master") - expect(find(".js-compare-from-dropdown .gl-new-dropdown-button-text")).to have_content("master") - expect(find(".js-compare-to-dropdown .gl-new-dropdown-button-text")).to have_content("master") + expect(find(".js-compare-from-dropdown .gl-dropdown-button-text")).to have_content("master") + expect(find(".js-compare-to-dropdown .gl-dropdown-button-text")).to have_content("master") end it_behaves_like 'compares branches' @@ -99,7 +99,7 @@ RSpec.describe "Compare", :js do find(".js-compare-from-dropdown .compare-dropdown-toggle").click - expect(find(".js-compare-from-dropdown .gl-new-dropdown-contents")).to have_selector('li.gl-new-dropdown-item', count: 1) + expect(find(".js-compare-from-dropdown .gl-dropdown-contents")).to have_selector('li.gl-dropdown-item', count: 1) end context 'when commit has overflow', :js do @@ -153,10 +153,10 @@ RSpec.describe "Compare", :js do visit project_compare_index_path(project, from: "master", to: "master") select_using_dropdown "from", "v1.0.0" - expect(find(".js-compare-from-dropdown .gl-new-dropdown-button-text")).to have_content("v1.0.0") + expect(find(".js-compare-from-dropdown .gl-dropdown-button-text")).to have_content("v1.0.0") select_using_dropdown "to", "v1.1.0" - expect(find(".js-compare-to-dropdown .gl-new-dropdown-button-text")).to have_content("v1.1.0") + expect(find(".js-compare-to-dropdown .gl-dropdown-button-text")).to have_content("v1.1.0") click_button "Compare" expect(page).to have_content "Commits" diff --git a/spec/features/projects/confluence/user_views_confluence_page_spec.rb b/spec/features/projects/confluence/user_views_confluence_page_spec.rb index 49e7839f16c..c1ce6ea4536 100644 --- a/spec/features/projects/confluence/user_views_confluence_page_spec.rb +++ b/spec/features/projects/confluence/user_views_confluence_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User views the Confluence page' do +RSpec.describe 'User views the Confluence page', feature_category: :integrations do let_it_be(:user) { create(:user) } let(:project) { create(:project, :public) } diff --git a/spec/features/projects/container_registry_spec.rb b/spec/features/projects/container_registry_spec.rb index e99af734c43..98cf024afa8 100644 --- a/spec/features/projects/container_registry_spec.rb +++ b/spec/features/projects/container_registry_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Container Registry', :js do +RSpec.describe 'Container Registry', :js, feature_category: :projects do include_context 'container registry tags' let(:user) { create(:user) } @@ -104,8 +104,6 @@ RSpec.describe 'Container Registry', :js do find('.modal .modal-footer .btn-danger').click end - it_behaves_like 'rejecting tags destruction for an importing repository on', tags: ['1'] - it('pagination navigate to the second page') do visit_next_page diff --git a/spec/features/projects/deploy_keys_spec.rb b/spec/features/projects/deploy_keys_spec.rb index 06462263f5a..bd48fb68304 100644 --- a/spec/features/projects/deploy_keys_spec.rb +++ b/spec/features/projects/deploy_keys_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project deploy keys', :js do +RSpec.describe 'Project deploy keys', :js, feature_category: :projects do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project_empty_repo) } let_it_be(:deploy_keys_project) { create(:deploy_keys_project, project: project) } diff --git a/spec/features/projects/diffs/diff_show_spec.rb b/spec/features/projects/diffs/diff_show_spec.rb index dcd6f1239bb..973c61de31d 100644 --- a/spec/features/projects/diffs/diff_show_spec.rb +++ b/spec/features/projects/diffs/diff_show_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Diff file viewer', :js, :with_clean_rails_cache do +RSpec.describe 'Diff file viewer', :js, :with_clean_rails_cache, feature_category: :code_review do let(:project) { create(:project, :public, :repository) } def visit_commit(sha, anchor: nil) diff --git a/spec/features/projects/environments/environment_metrics_spec.rb b/spec/features/projects/environments/environment_metrics_spec.rb index d486d8cf551..4a112445ab9 100644 --- a/spec/features/projects/environments/environment_metrics_spec.rb +++ b/spec/features/projects/environments/environment_metrics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Environment > Metrics' do +RSpec.describe 'Environment > Metrics', feature_category: :projects do include PrometheusHelpers let(:user) { create(:user) } diff --git a/spec/features/projects/environments/environment_spec.rb b/spec/features/projects/environments/environment_spec.rb index 706c880d097..75913082803 100644 --- a/spec/features/projects/environments/environment_spec.rb +++ b/spec/features/projects/environments/environment_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Environment' do +RSpec.describe 'Environment', feature_category: :projects do let_it_be(:project) { create(:project, :repository) } let(:user) { create(:user) } let(:role) { :developer } @@ -10,12 +10,83 @@ RSpec.describe 'Environment' do before do sign_in(user) project.add_role(user, role) + stub_feature_flags(environment_details_vue: false) end def auto_stop_button_selector %q{button[title="Prevent environment from auto-stopping"]} end + describe 'environment details page vue' do + let_it_be(:environment) { create(:environment, project: project) } + let!(:permissions) {} + let!(:deployment) {} + let!(:action) {} + let!(:cluster) {} + + before do + stub_feature_flags(environment_details_vue: true) + end + + context 'with auto-stop' do + let_it_be(:environment) { create(:environment, :will_auto_stop, name: 'staging', project: project) } + + before do + visit_environment(environment) + end + + it 'shows auto stop info', :js do + expect(page).to have_content('Auto stops') + end + + it 'shows auto stop button', :js do + expect(page).to have_selector(auto_stop_button_selector) + expect(page.find(auto_stop_button_selector).find(:xpath, '..')['action']).to have_content(cancel_auto_stop_project_environment_path(environment.project, environment)) + end + + it 'allows user to cancel auto stop', :js do + page.find(auto_stop_button_selector).click + wait_for_all_requests + expect(page).to have_content('Auto stop successfully canceled.') + expect(page).not_to have_selector(auto_stop_button_selector) + end + end + + context 'with deployments' do + before do + visit_environment(environment) + end + + context 'when there is a successful deployment' do + let(:pipeline) { create(:ci_pipeline, project: project) } + let(:build) { create(:ci_build, :success, pipeline: pipeline) } + + let(:deployment) do + create(:deployment, :success, environment: environment, deployable: build) + end + + it 'does show deployments', :js do + wait_for_requests + expect(page).to have_link("#{build.name} (##{build.id})") + end + end + + context 'when there is a failed deployment' do + let(:pipeline) { create(:ci_pipeline, project: project) } + let(:build) { create(:ci_build, pipeline: pipeline) } + + let(:deployment) do + create(:deployment, :failed, environment: environment, deployable: build) + end + + it 'does show deployments', :js do + wait_for_requests + expect(page).to have_link("#{build.name} (##{build.id})") + end + end + end + end + describe 'environment details page' do let_it_be(:environment) { create(:environment, project: project) } let!(:permissions) {} diff --git a/spec/features/projects/environments/environments_spec.rb b/spec/features/projects/environments/environments_spec.rb index b445b0da901..788bf6477b1 100644 --- a/spec/features/projects/environments/environments_spec.rb +++ b/spec/features/projects/environments/environments_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Environments page', :js do +RSpec.describe 'Environments page', :js, feature_category: :projects do include Spec::Support::Helpers::ModalHelpers let(:project) { create(:project) } diff --git a/spec/features/projects/feature_flag_user_lists/user_deletes_feature_flag_user_list_spec.rb b/spec/features/projects/feature_flag_user_lists/user_deletes_feature_flag_user_list_spec.rb index 37d6f299883..6383c3196c4 100644 --- a/spec/features/projects/feature_flag_user_lists/user_deletes_feature_flag_user_list_spec.rb +++ b/spec/features/projects/feature_flag_user_lists/user_deletes_feature_flag_user_list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User deletes feature flag user list', :js do +RSpec.describe 'User deletes feature flag user list', :js, feature_category: :projects do let_it_be(:project) { create(:project) } let_it_be(:developer) { create(:user) } diff --git a/spec/features/projects/feature_flag_user_lists/user_edits_feature_flag_user_list_spec.rb b/spec/features/projects/feature_flag_user_lists/user_edits_feature_flag_user_list_spec.rb index b37c2780827..8ab9e9baab9 100644 --- a/spec/features/projects/feature_flag_user_lists/user_edits_feature_flag_user_list_spec.rb +++ b/spec/features/projects/feature_flag_user_lists/user_edits_feature_flag_user_list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User edits feature flag user list', :js do +RSpec.describe 'User edits feature flag user list', :js, feature_category: :projects do let_it_be(:project) { create(:project) } let_it_be(:developer) { create(:user) } diff --git a/spec/features/projects/feature_flag_user_lists/user_sees_feature_flag_user_list_details_spec.rb b/spec/features/projects/feature_flag_user_lists/user_sees_feature_flag_user_list_details_spec.rb index dfebe6408bd..7614349c5a4 100644 --- a/spec/features/projects/feature_flag_user_lists/user_sees_feature_flag_user_list_details_spec.rb +++ b/spec/features/projects/feature_flag_user_lists/user_sees_feature_flag_user_list_details_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User sees feature flag user list details', :js do +RSpec.describe 'User sees feature flag user list details', :js, feature_category: :projects do let_it_be(:project) { create(:project) } let_it_be(:developer) { create(:user) } diff --git a/spec/features/projects/feature_flags/user_deletes_feature_flag_spec.rb b/spec/features/projects/feature_flags/user_deletes_feature_flag_spec.rb index 43540dc4522..852d7bca96a 100644 --- a/spec/features/projects/feature_flags/user_deletes_feature_flag_spec.rb +++ b/spec/features/projects/feature_flags/user_deletes_feature_flag_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User deletes feature flag', :js do +RSpec.describe 'User deletes feature flag', :js, feature_category: :feature_flags do include FeatureFlagHelpers let(:user) { create(:user) } diff --git a/spec/features/projects/feature_flags/user_sees_feature_flag_list_spec.rb b/spec/features/projects/feature_flags/user_sees_feature_flag_list_spec.rb index 949e530f86d..e2448887531 100644 --- a/spec/features/projects/feature_flags/user_sees_feature_flag_list_spec.rb +++ b/spec/features/projects/feature_flags/user_sees_feature_flag_list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User sees feature flag list', :js do +RSpec.describe 'User sees feature flag list', :js, feature_category: :feature_flags do include FeatureFlagHelpers let_it_be(:user) { create(:user) } @@ -42,7 +42,7 @@ RSpec.describe 'User sees feature flag list', :js do expect_status_toggle_button_not_to_be_checked within_feature_flag_scopes do - expect(page.find('[data-testid="strategy-badge"]')).to have_content('All Users: All Environments, review/*') + expect(page.find('[data-testid="strategy-label"]')).to have_content('All Users: All Environments, review/*') end end end @@ -66,7 +66,7 @@ RSpec.describe 'User sees feature flag list', :js do expect_status_toggle_button_to_be_checked within_feature_flag_scopes do - expect(page.find('[data-testid="strategy-badge"]')).to have_content('All Users: production') + expect(page.find('[data-testid="strategy-label"]')).to have_content('All Users: production') end end end diff --git a/spec/features/projects/feature_flags/user_updates_feature_flag_spec.rb b/spec/features/projects/feature_flags/user_updates_feature_flag_spec.rb index eb9ac078662..ce99ae92d63 100644 --- a/spec/features/projects/feature_flags/user_updates_feature_flag_spec.rb +++ b/spec/features/projects/feature_flags/user_updates_feature_flag_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User updates feature flag', :js do +RSpec.describe 'User updates feature flag', :js, feature_category: :feature_flags do include FeatureFlagHelpers let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/features_visibility_spec.rb b/spec/features/projects/features_visibility_spec.rb index 649c21d4459..5e0998412ed 100644 --- a/spec/features/projects/features_visibility_spec.rb +++ b/spec/features/projects/features_visibility_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Edit Project Settings' do +RSpec.describe 'Edit Project Settings', feature_category: :projects do let(:member) { create(:user) } let!(:project) { create(:project, :public, :repository) } let!(:issue) { create(:issue, project: project) } diff --git a/spec/features/projects/files/dockerfile_dropdown_spec.rb b/spec/features/projects/files/dockerfile_dropdown_spec.rb index dd1635c900e..1e05bdae204 100644 --- a/spec/features/projects/files/dockerfile_dropdown_spec.rb +++ b/spec/features/projects/files/dockerfile_dropdown_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > User wants to add a Dockerfile file', :js do +RSpec.describe 'Projects > Files > User wants to add a Dockerfile file', :js, feature_category: :projects do include Spec::Support::Helpers::Features::SourceEditorSpecHelpers before do diff --git a/spec/features/projects/files/download_buttons_spec.rb b/spec/features/projects/files/download_buttons_spec.rb index a486d7517ac..2710e2efa94 100644 --- a/spec/features/projects/files/download_buttons_spec.rb +++ b/spec/features/projects/files/download_buttons_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > Download buttons in files tree' do +RSpec.describe 'Projects > Files > Download buttons in files tree', feature_category: :projects do let(:project) { create(:project, :repository) } let(:user) { project.creator } diff --git a/spec/features/projects/files/edit_file_soft_wrap_spec.rb b/spec/features/projects/files/edit_file_soft_wrap_spec.rb index e08c53a67dd..f6342257847 100644 --- a/spec/features/projects/files/edit_file_soft_wrap_spec.rb +++ b/spec/features/projects/files/edit_file_soft_wrap_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > User uses soft wrap while editing file', :js do +RSpec.describe 'Projects > Files > User uses soft wrap while editing file', :js, feature_category: :projects do before do project = create(:project, :repository) user = project.first_owner diff --git a/spec/features/projects/files/editing_a_file_spec.rb b/spec/features/projects/files/editing_a_file_spec.rb index e256bec2a1c..04f45de42cc 100644 --- a/spec/features/projects/files/editing_a_file_spec.rb +++ b/spec/features/projects/files/editing_a_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > User wants to edit a file' do +RSpec.describe 'Projects > Files > User wants to edit a file', feature_category: :projects do let(:project) { create(:project, :repository) } let(:user) { project.first_owner } let(:commit_params) do diff --git a/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb b/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb index a283f7d128c..d791e22e4f8 100644 --- a/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb +++ b/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > User views files page' do +RSpec.describe 'Projects > Files > User views files page', feature_category: :projects do let(:project) { create(:forked_project_with_submodules) } let(:user) { project.first_owner } diff --git a/spec/features/projects/files/find_file_keyboard_spec.rb b/spec/features/projects/files/find_file_keyboard_spec.rb index 9ae3be4993b..19813396435 100644 --- a/spec/features/projects/files/find_file_keyboard_spec.rb +++ b/spec/features/projects/files/find_file_keyboard_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > Find file keyboard shortcuts', :js do +RSpec.describe 'Projects > Files > Find file keyboard shortcuts', :js, feature_category: :projects do let(:project) { create(:project, :repository) } let(:user) { project.first_owner } diff --git a/spec/features/projects/files/gitignore_dropdown_spec.rb b/spec/features/projects/files/gitignore_dropdown_spec.rb index a86adf951d8..5e11a94e65b 100644 --- a/spec/features/projects/files/gitignore_dropdown_spec.rb +++ b/spec/features/projects/files/gitignore_dropdown_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > User wants to add a .gitignore file', :js do +RSpec.describe 'Projects > Files > User wants to add a .gitignore file', :js, feature_category: :projects do include Spec::Support::Helpers::Features::SourceEditorSpecHelpers before do diff --git a/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb b/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb index 46ac0dee7eb..67678a937e5 100644 --- a/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb +++ b/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > User wants to add a .gitlab-ci.yml file', :js do +RSpec.describe 'Projects > Files > User wants to add a .gitlab-ci.yml file', :js, feature_category: :projects do include Spec::Support::Helpers::Features::SourceEditorSpecHelpers let(:params) { {} } diff --git a/spec/features/projects/files/project_owner_creates_license_file_spec.rb b/spec/features/projects/files/project_owner_creates_license_file_spec.rb index c9ba8cbd2bb..7ac9cb33060 100644 --- a/spec/features/projects/files/project_owner_creates_license_file_spec.rb +++ b/spec/features/projects/files/project_owner_creates_license_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > Project owner creates a license file', :js do +RSpec.describe 'Projects > Files > Project owner creates a license file', :js, feature_category: :projects do let(:project) { create(:project, :repository) } let(:project_maintainer) { project.first_owner } diff --git a/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb b/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb index 52686469243..8d64151e680 100644 --- a/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb +++ b/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb @@ -2,7 +2,8 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > Project owner sees a link to create a license file in empty project', :js do +RSpec.describe 'Projects > Files > Project owner sees a link to create a license file in empty project', :js, +feature_category: :projects do include WebIdeSpecHelpers let(:project) { create(:project_empty_repo) } diff --git a/spec/features/projects/files/template_selector_menu_spec.rb b/spec/features/projects/files/template_selector_menu_spec.rb index 51ae6616d4a..8dbfa3afb0b 100644 --- a/spec/features/projects/files/template_selector_menu_spec.rb +++ b/spec/features/projects/files/template_selector_menu_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Template selector menu', :js do +RSpec.describe 'Template selector menu', :js, feature_category: :projects do let(:project) { create(:project, :repository) } let(:user) { create(:user) } diff --git a/spec/features/projects/files/template_type_dropdown_spec.rb b/spec/features/projects/files/template_type_dropdown_spec.rb index 9cdb5eeb076..990b118d172 100644 --- a/spec/features/projects/files/template_type_dropdown_spec.rb +++ b/spec/features/projects/files/template_type_dropdown_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > Template type dropdown selector', :js do +RSpec.describe 'Projects > Files > Template type dropdown selector', :js, feature_category: :projects do let(:project) { create(:project, :repository) } let(:user) { project.first_owner } diff --git a/spec/features/projects/files/undo_template_spec.rb b/spec/features/projects/files/undo_template_spec.rb index 0b2daf12063..afc9a5fd232 100644 --- a/spec/features/projects/files/undo_template_spec.rb +++ b/spec/features/projects/files/undo_template_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > Template Undo Button', :js do +RSpec.describe 'Projects > Files > Template Undo Button', :js, feature_category: :projects do let(:project) { create(:project, :repository) } let(:user) { project.first_owner } diff --git a/spec/features/projects/files/user_browses_a_tree_with_a_folder_containing_only_a_folder_spec.rb b/spec/features/projects/files/user_browses_a_tree_with_a_folder_containing_only_a_folder_spec.rb index 220572c6a6d..8b60d21a77e 100644 --- a/spec/features/projects/files/user_browses_a_tree_with_a_folder_containing_only_a_folder_spec.rb +++ b/spec/features/projects/files/user_browses_a_tree_with_a_folder_containing_only_a_folder_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' # This is a regression test for https://gitlab.com/gitlab-org/gitlab-foss/issues/37569 -RSpec.describe 'Projects > Files > User browses a tree with a folder containing only a folder', :js do +RSpec.describe 'Projects > Files > User browses a tree with a folder containing only a folder', :js, +feature_category: :projects do let(:project) { create(:project, :empty_repo) } let(:user) { project.first_owner } diff --git a/spec/features/projects/files/user_browses_files_spec.rb b/spec/features/projects/files/user_browses_files_spec.rb index 0f3ce5a2bad..125f7209ab4 100644 --- a/spec/features/projects/files/user_browses_files_spec.rb +++ b/spec/features/projects/files/user_browses_files_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe "User browses files", :js do +RSpec.describe "User browses files", :js, feature_category: :projects do include RepoHelpers let(:fork_message) do @@ -86,6 +86,15 @@ RSpec.describe "User browses files", :js do visit(project_tree_path(project, "markdown")) end + it "redirects to the permalink URL" do + click_link(".gitignore") + click_link("Permalink") + + permalink_path = project_blob_path(project, "#{project.repository.commit('markdown').sha}/.gitignore") + + expect(page).to have_current_path(permalink_path, ignore_query: true) + end + it "shows correct files and links" do expect(page).to have_current_path(project_tree_path(project, "markdown"), ignore_query: true) expect(page).to have_content("README.md") @@ -262,6 +271,8 @@ RSpec.describe "User browses files", :js do context "when browsing a specific ref", :js do let(:ref) { project_tree_path(project, "6d39438") } + ref_selector = '.ref-selector' + before do visit(ref) end @@ -272,24 +283,34 @@ RSpec.describe "User browses files", :js do end it "shows files from a repository with apostroph in its name" do - first(".js-project-refs-dropdown").click + ref_name = 'test' - page.within(".project-refs-form") do - click_link("'test'") + find(ref_selector).click + wait_for_requests + + page.within(ref_selector) do + fill_in 'Search by Git revision', with: ref_name + wait_for_requests + find('li', text: ref_name, match: :prefer_exact).click end - expect(page).to have_selector(".dropdown-toggle-text", text: "'test'") + expect(find(ref_selector)).to have_text(ref_name) - visit(project_tree_path(project, "'test'")) + visit(project_tree_path(project, ref_name)) expect(page).not_to have_selector(".tree-commit .animation-container") end it "shows the code with a leading dot in the directory" do - first(".js-project-refs-dropdown").click + ref_name = 'fix' + + find(ref_selector).click + wait_for_requests - page.within(".project-refs-form") do - click_link("fix") + page.within(ref_selector) do + fill_in 'Search by Git revision', with: ref_name + wait_for_requests + find('li', text: ref_name, match: :prefer_exact).click end visit(project_tree_path(project, "fix/.testdir")) diff --git a/spec/features/projects/files/user_browses_lfs_files_spec.rb b/spec/features/projects/files/user_browses_lfs_files_spec.rb index 56e18871810..6b401d6d789 100644 --- a/spec/features/projects/files/user_browses_lfs_files_spec.rb +++ b/spec/features/projects/files/user_browses_lfs_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > User browses LFS files' do +RSpec.describe 'Projects > Files > User browses LFS files', feature_category: :projects do let(:project) { create(:project, :repository) } let(:user) { project.first_owner } diff --git a/spec/features/projects/files/user_creates_directory_spec.rb b/spec/features/projects/files/user_creates_directory_spec.rb index 9e0168d7ef3..4dd579ba8e9 100644 --- a/spec/features/projects/files/user_creates_directory_spec.rb +++ b/spec/features/projects/files/user_creates_directory_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > User creates a directory', :js do +RSpec.describe 'Projects > Files > User creates a directory', :js, feature_category: :projects do let(:fork_message) do "You're not allowed to make changes to this project directly. "\ "A fork of this project has been created that you can make changes in, so you can submit a merge request." diff --git a/spec/features/projects/files/user_creates_files_spec.rb b/spec/features/projects/files/user_creates_files_spec.rb index a81f31d663e..97ccb45dfc6 100644 --- a/spec/features/projects/files/user_creates_files_spec.rb +++ b/spec/features/projects/files/user_creates_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > User creates files', :js do +RSpec.describe 'Projects > Files > User creates files', :js, feature_category: :projects do include Spec::Support::Helpers::Features::SourceEditorSpecHelpers include BlobSpecHelpers diff --git a/spec/features/projects/files/user_deletes_files_spec.rb b/spec/features/projects/files/user_deletes_files_spec.rb index 806f1e8e9ed..61152a8badc 100644 --- a/spec/features/projects/files/user_deletes_files_spec.rb +++ b/spec/features/projects/files/user_deletes_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > User deletes files', :js do +RSpec.describe 'Projects > Files > User deletes files', :js, feature_category: :projects do let(:fork_message) do "You're not allowed to make changes to this project directly. "\ "A fork of this project has been created that you can make changes in, so you can submit a merge request." diff --git a/spec/features/projects/files/user_edits_files_spec.rb b/spec/features/projects/files/user_edits_files_spec.rb index 1a9c5483218..5a61aa146a2 100644 --- a/spec/features/projects/files/user_edits_files_spec.rb +++ b/spec/features/projects/files/user_edits_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > User edits files', :js do +RSpec.describe 'Projects > Files > User edits files', :js, feature_category: :projects do include Spec::Support::Helpers::Features::SourceEditorSpecHelpers include ProjectForksHelper include BlobSpecHelpers diff --git a/spec/features/projects/files/user_find_file_spec.rb b/spec/features/projects/files/user_find_file_spec.rb index 69ea8b0eb5f..1b53189da83 100644 --- a/spec/features/projects/files/user_find_file_spec.rb +++ b/spec/features/projects/files/user_find_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User find project file' do +RSpec.describe 'User find project file', feature_category: :projects do let(:user) { create :user } let(:project) { create :project, :repository } diff --git a/spec/features/projects/files/user_reads_pipeline_status_spec.rb b/spec/features/projects/files/user_reads_pipeline_status_spec.rb index 294a03813cd..18a5fb71b10 100644 --- a/spec/features/projects/files/user_reads_pipeline_status_spec.rb +++ b/spec/features/projects/files/user_reads_pipeline_status_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'user reads pipeline status', :js do +RSpec.describe 'user reads pipeline status', :js, feature_category: :projects do let(:project) { create(:project, :repository) } let(:user) { create(:user) } let(:v110_pipeline) { create_pipeline('v1.1.0', 'success') } diff --git a/spec/features/projects/files/user_replaces_files_spec.rb b/spec/features/projects/files/user_replaces_files_spec.rb index 1ecd50b6463..9fa3ddf92c6 100644 --- a/spec/features/projects/files/user_replaces_files_spec.rb +++ b/spec/features/projects/files/user_replaces_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > User replaces files', :js do +RSpec.describe 'Projects > Files > User replaces files', :js, feature_category: :projects do include DropzoneHelper let(:fork_message) do diff --git a/spec/features/projects/files/user_searches_for_files_spec.rb b/spec/features/projects/files/user_searches_for_files_spec.rb index cce73d06f94..b438b203141 100644 --- a/spec/features/projects/files/user_searches_for_files_spec.rb +++ b/spec/features/projects/files/user_searches_for_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > User searches for files' do +RSpec.describe 'Projects > Files > User searches for files', feature_category: :projects do let(:user) { project.first_owner } before do diff --git a/spec/features/projects/files/user_uploads_files_spec.rb b/spec/features/projects/files/user_uploads_files_spec.rb index cc621dfd9f8..575a6290a32 100644 --- a/spec/features/projects/files/user_uploads_files_spec.rb +++ b/spec/features/projects/files/user_uploads_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Files > User uploads files' do +RSpec.describe 'Projects > Files > User uploads files', feature_category: :projects do let(:user) { create(:user) } let(:project) { create(:project, :repository, name: 'Shop', creator: user) } let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') } diff --git a/spec/features/projects/fork_spec.rb b/spec/features/projects/fork_spec.rb index 9ceadb63178..3867f7fd086 100644 --- a/spec/features/projects/fork_spec.rb +++ b/spec/features/projects/fork_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project fork' do +RSpec.describe 'Project fork', feature_category: :projects do include ProjectForksHelper let(:user) { create(:user) } diff --git a/spec/features/projects/forks/fork_list_spec.rb b/spec/features/projects/forks/fork_list_spec.rb index b48c46ef8cb..18424c18cbc 100644 --- a/spec/features/projects/forks/fork_list_spec.rb +++ b/spec/features/projects/forks/fork_list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'listing forks of a project' do +RSpec.describe 'listing forks of a project', feature_category: :projects do include ProjectForksHelper include ExternalAuthorizationServiceHelpers diff --git a/spec/features/projects/gfm_autocomplete_load_spec.rb b/spec/features/projects/gfm_autocomplete_load_spec.rb index a7d68b07dd3..bb9f4e121d8 100644 --- a/spec/features/projects/gfm_autocomplete_load_spec.rb +++ b/spec/features/projects/gfm_autocomplete_load_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'GFM autocomplete loading', :js do +RSpec.describe 'GFM autocomplete loading', :js, feature_category: :projects do let(:project) { create(:project) } before do diff --git a/spec/features/projects/graph_spec.rb b/spec/features/projects/graph_spec.rb index 0b628ad1e9a..f96356b11c9 100644 --- a/spec/features/projects/graph_spec.rb +++ b/spec/features/projects/graph_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project Graph', :js do +RSpec.describe 'Project Graph', :js, feature_category: :projects do let(:user) { create :user } let(:project) { create(:project, :repository, namespace: user.namespace) } let(:branch_name) { 'master' } diff --git a/spec/features/projects/hook_logs/user_reads_log_spec.rb b/spec/features/projects/hook_logs/user_reads_log_spec.rb index 9b7ec14c36f..92ddc559cf4 100644 --- a/spec/features/projects/hook_logs/user_reads_log_spec.rb +++ b/spec/features/projects/hook_logs/user_reads_log_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Hook logs' do +RSpec.describe 'Hook logs', feature_category: :projects do let(:project) { create(:project) } let(:project_hook) { create(:project_hook, project: project) } let(:web_hook_log) { create(:web_hook_log, web_hook: project_hook, response_body: 'Hello World') } diff --git a/spec/features/projects/import_export/export_file_spec.rb b/spec/features/projects/import_export/export_file_spec.rb index ccf3ccc6a96..8986ce91ae3 100644 --- a/spec/features/projects/import_export/export_file_spec.rb +++ b/spec/features/projects/import_export/export_file_spec.rb @@ -6,7 +6,7 @@ require 'spec_helper' # It looks up for any sensitive word inside the JSON, so if a sensitive word is found # we'll have to either include it adding the model that includes it to the +safe_list+ # or make sure the attribute is blacklisted in the +import_export.yml+ configuration -RSpec.describe 'Import/Export - project export integration test', :js do +RSpec.describe 'Import/Export - project export integration test', :js, feature_category: :importers do include Select2Helper include ExportFileHelper @@ -53,7 +53,7 @@ RSpec.describe 'Import/Export - project export integration test', :js do project_json_path = File.join(tmpdir, 'project.json') expect(File).to exist(project_json_path) - project_hash = Gitlab::Json.parse(IO.read(project_json_path)) + project_hash = Gitlab::Json.parse(File.read(project_json_path)) sensitive_words.each do |sensitive_word| found = find_sensitive_attributes(sensitive_word, project_hash) @@ -79,7 +79,7 @@ RSpec.describe 'Import/Export - project export integration test', :js do expect(File).to exist(project_json_path) relations = [] - relations << Gitlab::Json.parse(IO.read(project_json_path)) + relations << Gitlab::Json.parse(File.read(project_json_path)) Dir.glob(File.join(tmpdir, 'tree/project', '*.ndjson')) do |rb_filename| File.foreach(rb_filename) do |line| relations << Gitlab::Json.parse(line) diff --git a/spec/features/projects/import_export/import_file_spec.rb b/spec/features/projects/import_export/import_file_spec.rb index 6f015f9cd22..8fb11f06cdd 100644 --- a/spec/features/projects/import_export/import_file_spec.rb +++ b/spec/features/projects/import_export/import_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Import/Export - project import integration test', :js do +RSpec.describe 'Import/Export - project import integration test', :js, feature_category: :importers do let(:user) { create(:user) } let(:file) { File.join(Rails.root, 'spec', 'features', 'projects', 'import_export', 'test_project_export.tar.gz') } let(:export_path) { "#{Dir.tmpdir}/import_file_spec" } diff --git a/spec/features/projects/infrastructure_registry_spec.rb b/spec/features/projects/infrastructure_registry_spec.rb index aab1cec8762..e1619726c8d 100644 --- a/spec/features/projects/infrastructure_registry_spec.rb +++ b/spec/features/projects/infrastructure_registry_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Infrastructure Registry' do +RSpec.describe 'Infrastructure Registry', feature_category: :projects do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project) } diff --git a/spec/features/projects/integrations/disable_triggers_spec.rb b/spec/features/projects/integrations/disable_triggers_spec.rb index b039d610ecb..f7afce6d87c 100644 --- a/spec/features/projects/integrations/disable_triggers_spec.rb +++ b/spec/features/projects/integrations/disable_triggers_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Disable individual triggers', :js do +RSpec.describe 'Disable individual triggers', :js, feature_category: :integrations do include_context 'project integration activation' let(:checkbox_selector) { 'input[name$="_events]"]' } diff --git a/spec/features/projects/integrations/project_integrations_spec.rb b/spec/features/projects/integrations/project_integrations_spec.rb index 708a5bca8c1..d99b6ca9092 100644 --- a/spec/features/projects/integrations/project_integrations_spec.rb +++ b/spec/features/projects/integrations/project_integrations_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project integrations', :js do +RSpec.describe 'Project integrations', :js, feature_category: :integrations do include_context 'project integration activation' it_behaves_like 'integration settings form' do diff --git a/spec/features/projects/integrations/user_activates_asana_spec.rb b/spec/features/projects/integrations/user_activates_asana_spec.rb index 9ec9f00529a..b99ca2ebc1c 100644 --- a/spec/features/projects/integrations/user_activates_asana_spec.rb +++ b/spec/features/projects/integrations/user_activates_asana_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User activates Asana' do +RSpec.describe 'User activates Asana', feature_category: :integrations do include_context 'project integration activation' it 'activates integration', :js do diff --git a/spec/features/projects/integrations/user_activates_assembla_spec.rb b/spec/features/projects/integrations/user_activates_assembla_spec.rb index be9034ec5ba..db5774e4514 100644 --- a/spec/features/projects/integrations/user_activates_assembla_spec.rb +++ b/spec/features/projects/integrations/user_activates_assembla_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User activates Assembla' do +RSpec.describe 'User activates Assembla', feature_category: :integrations do include_context 'project integration activation' before do diff --git a/spec/features/projects/integrations/user_activates_atlassian_bamboo_ci_spec.rb b/spec/features/projects/integrations/user_activates_atlassian_bamboo_ci_spec.rb index 49f62a34bd2..a532c1b8644 100644 --- a/spec/features/projects/integrations/user_activates_atlassian_bamboo_ci_spec.rb +++ b/spec/features/projects/integrations/user_activates_atlassian_bamboo_ci_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User activates Atlassian Bamboo CI' do +RSpec.describe 'User activates Atlassian Bamboo CI', feature_category: :integrations do include_context 'project integration activation' before do diff --git a/spec/features/projects/integrations/user_activates_emails_on_push_spec.rb b/spec/features/projects/integrations/user_activates_emails_on_push_spec.rb index 168779aad07..9a2d693a9f0 100644 --- a/spec/features/projects/integrations/user_activates_emails_on_push_spec.rb +++ b/spec/features/projects/integrations/user_activates_emails_on_push_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User activates Emails on push' do +RSpec.describe 'User activates Emails on push', feature_category: :integrations do include_context 'project integration activation' it 'activates integration', :js do diff --git a/spec/features/projects/integrations/user_activates_flowdock_spec.rb b/spec/features/projects/integrations/user_activates_flowdock_spec.rb deleted file mode 100644 index df1a4feddfb..00000000000 --- a/spec/features/projects/integrations/user_activates_flowdock_spec.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'User activates Flowdock' do - include_context 'project integration activation' do - let(:project) { create(:project, :repository) } - end - - before do - stub_request(:post, /.*api.flowdock.com.*/) - end - - it 'activates integration', :js do - visit_project_integration('Flowdock') - fill_in('Token', with: 'verySecret') - - click_test_then_save_integration(expect_test_to_fail: false) - - expect(page).to have_content('Flowdock settings saved and active.') - end -end diff --git a/spec/features/projects/integrations/user_activates_irker_spec.rb b/spec/features/projects/integrations/user_activates_irker_spec.rb index 23b5f2a5c47..17c46bfaff7 100644 --- a/spec/features/projects/integrations/user_activates_irker_spec.rb +++ b/spec/features/projects/integrations/user_activates_irker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User activates irker (IRC gateway)' do +RSpec.describe 'User activates irker (IRC gateway)', feature_category: :integrations do include_context 'project integration activation' it 'activates integration', :js do diff --git a/spec/features/projects/integrations/user_activates_jetbrains_teamcity_ci_spec.rb b/spec/features/projects/integrations/user_activates_jetbrains_teamcity_ci_spec.rb index f86a1b8a0a4..a18c052beb9 100644 --- a/spec/features/projects/integrations/user_activates_jetbrains_teamcity_ci_spec.rb +++ b/spec/features/projects/integrations/user_activates_jetbrains_teamcity_ci_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User activates JetBrains TeamCity CI' do +RSpec.describe 'User activates JetBrains TeamCity CI', feature_category: :integrations do include_context 'project integration activation' before do diff --git a/spec/features/projects/integrations/user_activates_jira_spec.rb b/spec/features/projects/integrations/user_activates_jira_spec.rb index dad201ffbb6..e4b10aeb340 100644 --- a/spec/features/projects/integrations/user_activates_jira_spec.rb +++ b/spec/features/projects/integrations/user_activates_jira_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User activates Jira', :js do +RSpec.describe 'User activates Jira', :js, feature_category: :integrations do include_context 'project integration activation' include_context 'project integration Jira context' diff --git a/spec/features/projects/integrations/user_activates_mattermost_slash_command_spec.rb b/spec/features/projects/integrations/user_activates_mattermost_slash_command_spec.rb index 54c9ec0f62e..16c7a3ff226 100644 --- a/spec/features/projects/integrations/user_activates_mattermost_slash_command_spec.rb +++ b/spec/features/projects/integrations/user_activates_mattermost_slash_command_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Set up Mattermost slash commands', :js do +RSpec.describe 'Set up Mattermost slash commands', :js, feature_category: :integrations do describe 'user visits the mattermost slash command config page' do include_context 'project integration activation' diff --git a/spec/features/projects/integrations/user_activates_packagist_spec.rb b/spec/features/projects/integrations/user_activates_packagist_spec.rb index 0892843e840..2d77abfea7c 100644 --- a/spec/features/projects/integrations/user_activates_packagist_spec.rb +++ b/spec/features/projects/integrations/user_activates_packagist_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User activates Packagist' do +RSpec.describe 'User activates Packagist', feature_category: :integrations do include_context 'project integration activation' before do diff --git a/spec/features/projects/integrations/user_activates_pivotaltracker_spec.rb b/spec/features/projects/integrations/user_activates_pivotaltracker_spec.rb index fe6ed786ace..b4dec8ffdb5 100644 --- a/spec/features/projects/integrations/user_activates_pivotaltracker_spec.rb +++ b/spec/features/projects/integrations/user_activates_pivotaltracker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User activates PivotalTracker' do +RSpec.describe 'User activates PivotalTracker', feature_category: :integrations do include_context 'project integration activation' before do diff --git a/spec/features/projects/integrations/user_activates_prometheus_spec.rb b/spec/features/projects/integrations/user_activates_prometheus_spec.rb index 56b895919b8..5b2d885410f 100644 --- a/spec/features/projects/integrations/user_activates_prometheus_spec.rb +++ b/spec/features/projects/integrations/user_activates_prometheus_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User activates Prometheus' do +RSpec.describe 'User activates Prometheus', feature_category: :integrations do include_context 'project integration activation' before do diff --git a/spec/features/projects/integrations/user_activates_pushover_spec.rb b/spec/features/projects/integrations/user_activates_pushover_spec.rb index 616efdc836f..a705c354a1e 100644 --- a/spec/features/projects/integrations/user_activates_pushover_spec.rb +++ b/spec/features/projects/integrations/user_activates_pushover_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User activates Pushover' do +RSpec.describe 'User activates Pushover', feature_category: :integrations do include_context 'project integration activation' before do diff --git a/spec/features/projects/integrations/user_activates_slack_notifications_spec.rb b/spec/features/projects/integrations/user_activates_slack_notifications_spec.rb index e89f6e309ea..01c202baf70 100644 --- a/spec/features/projects/integrations/user_activates_slack_notifications_spec.rb +++ b/spec/features/projects/integrations/user_activates_slack_notifications_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User activates Slack notifications', :js do +RSpec.describe 'User activates Slack notifications', :js, feature_category: :integrations do include_context 'project integration activation' context 'when integration is not configured yet' do diff --git a/spec/features/projects/integrations/user_activates_slack_slash_command_spec.rb b/spec/features/projects/integrations/user_activates_slack_slash_command_spec.rb index df8cd84ffdb..0f6d721565e 100644 --- a/spec/features/projects/integrations/user_activates_slack_slash_command_spec.rb +++ b/spec/features/projects/integrations/user_activates_slack_slash_command_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Slack slash commands', :js do +RSpec.describe 'Slack slash commands', :js, feature_category: :integrations do include_context 'project integration activation' before do diff --git a/spec/features/projects/integrations/user_uses_inherited_settings_spec.rb b/spec/features/projects/integrations/user_uses_inherited_settings_spec.rb index 8a2881c95dc..e0063a9c733 100644 --- a/spec/features/projects/integrations/user_uses_inherited_settings_spec.rb +++ b/spec/features/projects/integrations/user_uses_inherited_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User uses inherited settings', :js do +RSpec.describe 'User uses inherited settings', :js, feature_category: :integrations do include JiraIntegrationHelpers include_context 'project integration activation' diff --git a/spec/features/projects/integrations/user_views_services_spec.rb b/spec/features/projects/integrations/user_views_services_spec.rb index 559461f911f..e6be300c0a9 100644 --- a/spec/features/projects/integrations/user_views_services_spec.rb +++ b/spec/features/projects/integrations/user_views_services_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User views integrations', :js do +RSpec.describe 'User views integrations', :js, feature_category: :integrations do include_context 'project integration activation' it 'shows the list of available integrations' do diff --git a/spec/features/projects/issuable_templates_spec.rb b/spec/features/projects/issuable_templates_spec.rb index ac83de3e765..adf410ce6e8 100644 --- a/spec/features/projects/issuable_templates_spec.rb +++ b/spec/features/projects/issuable_templates_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'issuable templates', :js do +RSpec.describe 'issuable templates', :js, feature_category: :projects do include ProjectForksHelper let(:user) { create(:user) } diff --git a/spec/features/projects/issues/design_management/user_links_to_designs_in_issue_spec.rb b/spec/features/projects/issues/design_management/user_links_to_designs_in_issue_spec.rb index 78fb470d4ea..ef7022dcda8 100644 --- a/spec/features/projects/issues/design_management/user_links_to_designs_in_issue_spec.rb +++ b/spec/features/projects/issues/design_management/user_links_to_designs_in_issue_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'viewing issues with design references' do +RSpec.describe 'viewing issues with design references', feature_category: :design_management do include DesignManagementTestHelpers let_it_be(:public_project) { create(:project_empty_repo, :public) } diff --git a/spec/features/projects/issues/design_management/user_paginates_designs_spec.rb b/spec/features/projects/issues/design_management/user_paginates_designs_spec.rb index 908e30478b2..1490702a964 100644 --- a/spec/features/projects/issues/design_management/user_paginates_designs_spec.rb +++ b/spec/features/projects/issues/design_management/user_paginates_designs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User paginates issue designs', :js do +RSpec.describe 'User paginates issue designs', :js, feature_category: :design_management do include DesignManagementTestHelpers let(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/projects/issues/design_management/user_permissions_upload_spec.rb b/spec/features/projects/issues/design_management/user_permissions_upload_spec.rb index cfd8a4540ee..094bc9218ed 100644 --- a/spec/features/projects/issues/design_management/user_permissions_upload_spec.rb +++ b/spec/features/projects/issues/design_management/user_permissions_upload_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User design permissions', :js do +RSpec.describe 'User design permissions', :js, feature_category: :design_management do include DesignManagementTestHelpers let(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb b/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb index 27d0be23aec..858d6751afa 100644 --- a/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb +++ b/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User uploads new design', :js do +RSpec.describe 'User uploads new design', :js, feature_category: :design_management do include DesignManagementTestHelpers let(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/projects/issues/design_management/user_views_design_images_spec.rb b/spec/features/projects/issues/design_management/user_views_design_images_spec.rb index c3aefe05f75..c5fc11222c2 100644 --- a/spec/features/projects/issues/design_management/user_views_design_images_spec.rb +++ b/spec/features/projects/issues/design_management/user_views_design_images_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Users views raw design image files' do +RSpec.describe 'Users views raw design image files', feature_category: :design_management do include DesignManagementTestHelpers let_it_be(:project) { create(:project, :public) } diff --git a/spec/features/projects/issues/design_management/user_views_design_spec.rb b/spec/features/projects/issues/design_management/user_views_design_spec.rb index b513a4fe3fa..11c8bdda3ac 100644 --- a/spec/features/projects/issues/design_management/user_views_design_spec.rb +++ b/spec/features/projects/issues/design_management/user_views_design_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User views issue designs', :js do +RSpec.describe 'User views issue designs', :js, feature_category: :design_management do include DesignManagementTestHelpers let_it_be(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/projects/issues/design_management/user_views_designs_spec.rb b/spec/features/projects/issues/design_management/user_views_designs_spec.rb index 46c772027ad..995ed66df98 100644 --- a/spec/features/projects/issues/design_management/user_views_designs_spec.rb +++ b/spec/features/projects/issues/design_management/user_views_designs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User views issue designs', :js do +RSpec.describe 'User views issue designs', :js, feature_category: :design_management do include DesignManagementTestHelpers let_it_be(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/projects/issues/design_management/user_views_designs_with_svg_xss_spec.rb b/spec/features/projects/issues/design_management/user_views_designs_with_svg_xss_spec.rb index 682a45cf592..a45b9b718c3 100644 --- a/spec/features/projects/issues/design_management/user_views_designs_with_svg_xss_spec.rb +++ b/spec/features/projects/issues/design_management/user_views_designs_with_svg_xss_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User views an SVG design that contains XSS', :js do +RSpec.describe 'User views an SVG design that contains XSS', :js, feature_category: :design_management do include DesignManagementTestHelpers let(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/projects/issues/email_participants_spec.rb b/spec/features/projects/issues/email_participants_spec.rb index 3ffe0a5ced8..4dedbff608e 100644 --- a/spec/features/projects/issues/email_participants_spec.rb +++ b/spec/features/projects/issues/email_participants_spec.rb @@ -2,16 +2,15 @@ require 'spec_helper' -RSpec.describe 'viewing an issue', :js do +RSpec.describe 'viewing an issue', :js, feature_category: :issue_email_participants do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, :public) } - let_it_be(:issue) { create(:issue, project: project) } + let_it_be_with_refind(:issue) { create(:issue, project: project) } let_it_be(:note) { create(:note_on_issue, project: project, noteable: issue) } let_it_be(:participants) { create_list(:issue_email_participant, 4, issue: issue) } before do - sign_in(user) - visit project_issue_path(project, issue) + project.add_reporter(user) end shared_examples 'email participants warning' do |selector| @@ -20,15 +19,48 @@ RSpec.describe 'viewing an issue', :js do end end - context 'for a new note' do - it_behaves_like 'email participants warning', '.new-note' + shared_examples 'no email participants warning' do |selector| + it 'does not show email participants warning' do + expect(find(selector)).not_to have_content(", and 1 more will be notified of your comment") + end + end + + context 'when issue is confidential' do + before do + issue.update!(confidential: true) + sign_in(user) + visit project_issue_path(project, issue) + end + + context 'for a new note' do + it_behaves_like 'email participants warning', '.new-note' + end + + context 'for a reply form' do + before do + find('.js-reply-button').click + end + + it_behaves_like 'email participants warning', '.note-edit-form' + end end - context 'for a reply form' do + context 'when issue is not confidential' do before do - find('.js-reply-button').click + sign_in(user) + visit project_issue_path(project, issue) end - it_behaves_like 'email participants warning', '.note-edit-form' + context 'for a new note' do + it_behaves_like 'no email participants warning', '.new-note' + end + + context 'for a reply form' do + before do + find('.js-reply-button').click + end + + it_behaves_like 'no email participants warning', '.note-edit-form' + end end end diff --git a/spec/features/projects/issues/viewing_relocated_issues_spec.rb b/spec/features/projects/issues/viewing_relocated_issues_spec.rb index 10d5ad1747c..abd36b3ceef 100644 --- a/spec/features/projects/issues/viewing_relocated_issues_spec.rb +++ b/spec/features/projects/issues/viewing_relocated_issues_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'issues canonical link' do +RSpec.describe 'issues canonical link', feature_category: :team_planning do include Spec::Support::Helpers::Features::CanonicalLinkHelpers let_it_be(:original_project) { create(:project, :public) } diff --git a/spec/features/projects/jobs/permissions_spec.rb b/spec/features/projects/jobs/permissions_spec.rb index 740d009d6b8..c3c0043a6ef 100644 --- a/spec/features/projects/jobs/permissions_spec.rb +++ b/spec/features/projects/jobs/permissions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project Jobs Permissions' do +RSpec.describe 'Project Jobs Permissions', feature_category: :projects do using RSpec::Parameterized::TableSyntax let_it_be_with_reload(:group) { create(:group, name: 'some group') } diff --git a/spec/features/projects/jobs/user_browses_job_spec.rb b/spec/features/projects/jobs/user_browses_job_spec.rb index 6a0cfcde812..78fb72ad2df 100644 --- a/spec/features/projects/jobs/user_browses_job_spec.rb +++ b/spec/features/projects/jobs/user_browses_job_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User browses a job', :js do +RSpec.describe 'User browses a job', :js, feature_category: :projects do include Spec::Support::Helpers::ModalHelpers let(:user) { create(:user) } diff --git a/spec/features/projects/jobs/user_browses_jobs_spec.rb b/spec/features/projects/jobs/user_browses_jobs_spec.rb index cb3c1594868..1634f6dee74 100644 --- a/spec/features/projects/jobs/user_browses_jobs_spec.rb +++ b/spec/features/projects/jobs/user_browses_jobs_spec.rb @@ -8,7 +8,7 @@ def visit_jobs_page wait_for_requests end -RSpec.describe 'User browses jobs' do +RSpec.describe 'User browses jobs', feature_category: :projects do describe 'Jobs', :js do let(:project) { create(:project, :repository) } let(:user) { create(:user) } diff --git a/spec/features/projects/jobs/user_triggers_manual_job_with_variables_spec.rb b/spec/features/projects/jobs/user_triggers_manual_job_with_variables_spec.rb index eea7e070a35..a9e0fce1a1c 100644 --- a/spec/features/projects/jobs/user_triggers_manual_job_with_variables_spec.rb +++ b/spec/features/projects/jobs/user_triggers_manual_job_with_variables_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User triggers manual job with variables', :js do +RSpec.describe 'User triggers manual job with variables', :js, feature_category: :projects do let(:user) { create(:user) } let(:user_access_level) { :developer } let(:project) { create(:project, :repository, namespace: user.namespace) } diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb index 96a8168e708..557a20ff2d6 100644 --- a/spec/features/projects/jobs_spec.rb +++ b/spec/features/projects/jobs_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'tempfile' -RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state do +RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state, feature_category: :projects do include Gitlab::Routing include ProjectForksHelper @@ -215,10 +215,6 @@ RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state do visit project_job_path(project, job) end - it 'shows retry button' do - expect(page).to have_link('Retry') - end - context 'if job passed' do it 'does not show New issue button' do expect(page).not_to have_link('New issue') diff --git a/spec/features/projects/labels/issues_sorted_by_priority_spec.rb b/spec/features/projects/labels/issues_sorted_by_priority_spec.rb index 91a30004fc3..846a0a25891 100644 --- a/spec/features/projects/labels/issues_sorted_by_priority_spec.rb +++ b/spec/features/projects/labels/issues_sorted_by_priority_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Issue prioritization' do +RSpec.describe 'Issue prioritization', feature_category: :team_planning do let(:user) { create(:user) } let(:project) { create(:project, name: 'test', namespace: user.namespace) } diff --git a/spec/features/projects/labels/search_labels_spec.rb b/spec/features/projects/labels/search_labels_spec.rb index 04dfd4ca5f1..d058565925e 100644 --- a/spec/features/projects/labels/search_labels_spec.rb +++ b/spec/features/projects/labels/search_labels_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Search for labels', :js do +RSpec.describe 'Search for labels', :js, feature_category: :team_planning do let(:user) { create(:user) } let(:project) { create(:project) } let!(:label1) { create(:label, title: 'Foo', description: 'Lorem ipsum', project: project) } diff --git a/spec/features/projects/labels/sort_labels_spec.rb b/spec/features/projects/labels/sort_labels_spec.rb index f2f1acd2348..378a575348e 100644 --- a/spec/features/projects/labels/sort_labels_spec.rb +++ b/spec/features/projects/labels/sort_labels_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Sort labels', :js do +RSpec.describe 'Sort labels', :js, feature_category: :team_planning do let(:user) { create(:user) } let(:project) { create(:project) } let!(:label1) { create(:label, title: 'Foo', description: 'Lorem ipsum', project: project) } diff --git a/spec/features/projects/labels/subscription_spec.rb b/spec/features/projects/labels/subscription_spec.rb index 7ca8a542c21..f1537458a18 100644 --- a/spec/features/projects/labels/subscription_spec.rb +++ b/spec/features/projects/labels/subscription_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Labels subscription' do +RSpec.describe 'Labels subscription', feature_category: :team_planning do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, :public, namespace: group) } diff --git a/spec/features/projects/labels/update_prioritization_spec.rb b/spec/features/projects/labels/update_prioritization_spec.rb index 706ea92c086..b527b8926a0 100644 --- a/spec/features/projects/labels/update_prioritization_spec.rb +++ b/spec/features/projects/labels/update_prioritization_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Prioritize labels' do +RSpec.describe 'Prioritize labels', feature_category: :team_planning do include DragTo let(:user) { create(:user) } diff --git a/spec/features/projects/labels/user_creates_labels_spec.rb b/spec/features/projects/labels/user_creates_labels_spec.rb index 001d23cd2c9..46729048fe7 100644 --- a/spec/features/projects/labels/user_creates_labels_spec.rb +++ b/spec/features/projects/labels/user_creates_labels_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe "User creates labels" do +RSpec.describe "User creates labels", feature_category: :team_planning do let_it_be(:project) { create(:project_empty_repo, :public) } let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/labels/user_edits_labels_spec.rb b/spec/features/projects/labels/user_edits_labels_spec.rb index 999c238c7b3..f90f215f9fc 100644 --- a/spec/features/projects/labels/user_edits_labels_spec.rb +++ b/spec/features/projects/labels/user_edits_labels_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe "User edits labels" do +RSpec.describe "User edits labels", feature_category: :team_planning do include Spec::Support::Helpers::ModalHelpers let_it_be(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/projects/labels/user_promotes_label_spec.rb b/spec/features/projects/labels/user_promotes_label_spec.rb index 4cb22c2e48c..e130dc561da 100644 --- a/spec/features/projects/labels/user_promotes_label_spec.rb +++ b/spec/features/projects/labels/user_promotes_label_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User promotes label' do +RSpec.describe 'User promotes label', feature_category: :team_planning do let_it_be(:group) { create(:group) } let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, namespace: group) } diff --git a/spec/features/projects/labels/user_removes_labels_spec.rb b/spec/features/projects/labels/user_removes_labels_spec.rb index 11d73a56965..55dc52b8ccf 100644 --- a/spec/features/projects/labels/user_removes_labels_spec.rb +++ b/spec/features/projects/labels/user_removes_labels_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe "User removes labels" do +RSpec.describe "User removes labels", feature_category: :team_planning do let(:project) { create(:project_empty_repo, :public) } let(:user) { create(:user) } diff --git a/spec/features/projects/labels/user_sees_breadcrumb_links_spec.rb b/spec/features/projects/labels/user_sees_breadcrumb_links_spec.rb index f9c65c08ec0..117371e6904 100644 --- a/spec/features/projects/labels/user_sees_breadcrumb_links_spec.rb +++ b/spec/features/projects/labels/user_sees_breadcrumb_links_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'New project label breadcrumb' do +RSpec.describe 'New project label breadcrumb', feature_category: :team_planning do let(:project) { create(:project) } let(:user) { project.creator } diff --git a/spec/features/projects/labels/user_sees_links_to_issuables_spec.rb b/spec/features/projects/labels/user_sees_links_to_issuables_spec.rb index 6f98883a412..d8c673a2ce5 100644 --- a/spec/features/projects/labels/user_sees_links_to_issuables_spec.rb +++ b/spec/features/projects/labels/user_sees_links_to_issuables_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Labels > User sees links to issuables' do +RSpec.describe 'Projects > Labels > User sees links to issuables', feature_category: :team_planning do let_it_be(:user) { create(:user) } before do diff --git a/spec/features/projects/labels/user_views_labels_spec.rb b/spec/features/projects/labels/user_views_labels_spec.rb index 7a6942b6259..b5a9a735af9 100644 --- a/spec/features/projects/labels/user_views_labels_spec.rb +++ b/spec/features/projects/labels/user_views_labels_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe "User views labels" do +RSpec.describe "User views labels", feature_category: :team_planning do let_it_be(:project) { create(:project_empty_repo, :public) } let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/members/group_member_cannot_leave_group_project_spec.rb b/spec/features/projects/members/group_member_cannot_leave_group_project_spec.rb index c9fee9bee7a..63dc99efc8f 100644 --- a/spec/features/projects/members/group_member_cannot_leave_group_project_spec.rb +++ b/spec/features/projects/members/group_member_cannot_leave_group_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Members > Group member cannot leave group project' do +RSpec.describe 'Projects > Members > Group member cannot leave group project', feature_category: :subgroups do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, namespace: group) } diff --git a/spec/features/projects/members/group_member_cannot_request_access_to_his_group_project_spec.rb b/spec/features/projects/members/group_member_cannot_request_access_to_his_group_project_spec.rb index 34c870b8a96..07886950b95 100644 --- a/spec/features/projects/members/group_member_cannot_request_access_to_his_group_project_spec.rb +++ b/spec/features/projects/members/group_member_cannot_request_access_to_his_group_project_spec.rb @@ -2,7 +2,8 @@ require 'spec_helper' -RSpec.describe 'Projects > Members > Group member cannot request access to their group project' do +RSpec.describe 'Projects > Members > Group member cannot request access to their group project', +feature_category: :subgroups do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, namespace: group) } diff --git a/spec/features/projects/members/group_members_spec.rb b/spec/features/projects/members/group_members_spec.rb index 6aa6acbdae4..416b96ab668 100644 --- a/spec/features/projects/members/group_members_spec.rb +++ b/spec/features/projects/members/group_members_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects members', :js do +RSpec.describe 'Projects members', :js, feature_category: :subgroups do include Spec::Support::Helpers::Features::MembersHelpers let(:user) { create(:user) } diff --git a/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb b/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb index ec86b7db4fa..7a11ee61c5f 100644 --- a/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb +++ b/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb @@ -2,7 +2,8 @@ require 'spec_helper' -RSpec.describe 'Projects > Members > Group requester cannot request access to project', :js do +RSpec.describe 'Projects > Members > Group requester cannot request access to project', :js, +feature_category: :subgroups do let(:user) { create(:user) } let(:owner) { create(:user) } let(:group) { create(:group, :public) } diff --git a/spec/features/projects/members/groups_with_access_list_spec.rb b/spec/features/projects/members/groups_with_access_list_spec.rb index 821b9249aa8..51acba246c5 100644 --- a/spec/features/projects/members/groups_with_access_list_spec.rb +++ b/spec/features/projects/members/groups_with_access_list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Members > Groups with access list', :js do +RSpec.describe 'Projects > Members > Groups with access list', :js, feature_category: :subgroups do include Spec::Support::Helpers::Features::MembersHelpers include Spec::Support::Helpers::ModalHelpers include Spec::Support::Helpers::Features::InviteMembersModalHelper diff --git a/spec/features/projects/members/manage_groups_spec.rb b/spec/features/projects/members/manage_groups_spec.rb index e86affbbca1..b78bfacf171 100644 --- a/spec/features/projects/members/manage_groups_spec.rb +++ b/spec/features/projects/members/manage_groups_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project > Members > Manage groups', :js do +RSpec.describe 'Project > Members > Manage groups', :js, feature_category: :subgroups do include ActionView::Helpers::DateHelper include Spec::Support::Helpers::Features::MembersHelpers include Spec::Support::Helpers::Features::InviteMembersModalHelper diff --git a/spec/features/projects/members/manage_members_spec.rb b/spec/features/projects/members/manage_members_spec.rb index 1f317c55256..3ffa402dc2c 100644 --- a/spec/features/projects/members/manage_members_spec.rb +++ b/spec/features/projects/members/manage_members_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Members > Manage members', :js, product_group: :onboarding do +RSpec.describe 'Projects > Members > Manage members', :js, feature_category: :onboarding do include Spec::Support::Helpers::Features::MembersHelpers include Spec::Support::Helpers::Features::InviteMembersModalHelper include Spec::Support::Helpers::ModalHelpers @@ -104,7 +104,6 @@ RSpec.describe 'Projects > Members > Manage members', :js, product_group: :onboa click_on 'Invite members' - click_on 'Guest' wait_for_requests end @@ -112,13 +111,7 @@ RSpec.describe 'Projects > Members > Manage members', :js, product_group: :onboa let(:current_user) { project_owner } it 'shows Owner in the dropdown' do - page.within '.dropdown-menu' do - expect(page).to have_button('Guest') - expect(page).to have_button('Reporter') - expect(page).to have_button('Developer') - expect(page).to have_button('Maintainer') - expect(page).to have_button('Owner') - end + expect(page).to have_select('Select a role', options: %w[Guest Reporter Developer Maintainer Owner]) end end @@ -126,13 +119,8 @@ RSpec.describe 'Projects > Members > Manage members', :js, product_group: :onboa let(:current_user) { project_maintainer } it 'does not show the Owner option' do - page.within '.dropdown-menu' do - expect(page).to have_button('Guest') - expect(page).to have_button('Reporter') - expect(page).to have_button('Developer') - expect(page).to have_button('Maintainer') - expect(page).not_to have_button('Owner') - end + expect(page).to have_select('Select a role', options: %w[Guest Reporter Developer Maintainer]) + expect(page).not_to have_select('Select a role', options: %w[Owner]) end end end diff --git a/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb b/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb index c92e8bc2954..31c8237aacc 100644 --- a/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb +++ b/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Members > Maintainer adds member with expiration date', :js do +RSpec.describe 'Projects > Members > Maintainer adds member with expiration date', :js, feature_category: :subgroups do include ActiveSupport::Testing::TimeHelpers include Spec::Support::Helpers::Features::MembersHelpers include Spec::Support::Helpers::Features::InviteMembersModalHelper diff --git a/spec/features/projects/members/master_manages_access_requests_spec.rb b/spec/features/projects/members/master_manages_access_requests_spec.rb index f4e8c55e3cc..cea59679226 100644 --- a/spec/features/projects/members/master_manages_access_requests_spec.rb +++ b/spec/features/projects/members/master_manages_access_requests_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Members > Maintainer manages access requests' do +RSpec.describe 'Projects > Members > Maintainer manages access requests', feature_category: :subgroups do it_behaves_like 'Maintainer manages access requests' do let(:entity) { create(:project, :public, :with_namespace_settings) } let(:members_page_path) { project_project_members_path(entity) } diff --git a/spec/features/projects/members/member_cannot_request_access_to_his_project_spec.rb b/spec/features/projects/members/member_cannot_request_access_to_his_project_spec.rb index fa02e815867..dc18ca88c36 100644 --- a/spec/features/projects/members/member_cannot_request_access_to_his_project_spec.rb +++ b/spec/features/projects/members/member_cannot_request_access_to_his_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Members > Member cannot request access to their project' do +RSpec.describe 'Projects > Members > Member cannot request access to their project', feature_category: :subgroups do let(:member) { create(:user) } let(:project) { create(:project) } diff --git a/spec/features/projects/members/member_leaves_project_spec.rb b/spec/features/projects/members/member_leaves_project_spec.rb index db227f3701d..2632bc2f5bd 100644 --- a/spec/features/projects/members/member_leaves_project_spec.rb +++ b/spec/features/projects/members/member_leaves_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Members > Member leaves project' do +RSpec.describe 'Projects > Members > Member leaves project', feature_category: :subgroups do include Spec::Support::Helpers::Features::MembersHelpers include Spec::Support::Helpers::ModalHelpers diff --git a/spec/features/projects/members/owner_cannot_leave_project_spec.rb b/spec/features/projects/members/owner_cannot_leave_project_spec.rb index 45a8f979b87..7908fd3a98f 100644 --- a/spec/features/projects/members/owner_cannot_leave_project_spec.rb +++ b/spec/features/projects/members/owner_cannot_leave_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Members > Owner cannot leave project' do +RSpec.describe 'Projects > Members > Owner cannot leave project', feature_category: :subgroups do let(:project) { create(:project) } before do diff --git a/spec/features/projects/members/owner_cannot_request_access_to_his_project_spec.rb b/spec/features/projects/members/owner_cannot_request_access_to_his_project_spec.rb index fad5d831c19..b5a862578d3 100644 --- a/spec/features/projects/members/owner_cannot_request_access_to_his_project_spec.rb +++ b/spec/features/projects/members/owner_cannot_request_access_to_his_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Members > Owner cannot request access to their own project' do +RSpec.describe 'Projects > Members > Owner cannot request access to their own project', feature_category: :subgroups do let(:project) { create(:project) } before do diff --git a/spec/features/projects/members/sorting_spec.rb b/spec/features/projects/members/sorting_spec.rb index 8aadd6302d0..5c72d9efeb3 100644 --- a/spec/features/projects/members/sorting_spec.rb +++ b/spec/features/projects/members/sorting_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Members > Sorting', :js do +RSpec.describe 'Projects > Members > Sorting', :js, feature_category: :subgroups do include Spec::Support::Helpers::Features::MembersHelpers let(:maintainer) { create(:user, name: 'John Doe', created_at: 5.days.ago, last_activity_on: Date.today) } diff --git a/spec/features/projects/members/tabs_spec.rb b/spec/features/projects/members/tabs_spec.rb index 5611e7ee810..232420224fc 100644 --- a/spec/features/projects/members/tabs_spec.rb +++ b/spec/features/projects/members/tabs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Members > Tabs', :js do +RSpec.describe 'Projects > Members > Tabs', :js, feature_category: :subgroups do include Spec::Support::Helpers::Features::MembersHelpers using RSpec::Parameterized::TableSyntax diff --git a/spec/features/projects/members/user_requests_access_spec.rb b/spec/features/projects/members/user_requests_access_spec.rb index be124502c32..11d162fabd4 100644 --- a/spec/features/projects/members/user_requests_access_spec.rb +++ b/spec/features/projects/members/user_requests_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Members > User requests access', :js do +RSpec.describe 'Projects > Members > User requests access', :js, feature_category: :subgroups do include Spec::Support::Helpers::ModalHelpers let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/merge_request_button_spec.rb b/spec/features/projects/merge_request_button_spec.rb index eb52a7821f9..56aee469252 100644 --- a/spec/features/projects/merge_request_button_spec.rb +++ b/spec/features/projects/merge_request_button_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Merge Request button' do +RSpec.describe 'Merge Request button', feature_category: :projects do include ProjectForksHelper let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/milestones/gfm_autocomplete_spec.rb b/spec/features/projects/milestones/gfm_autocomplete_spec.rb index 547a5d11dec..d4ce10b5cb5 100644 --- a/spec/features/projects/milestones/gfm_autocomplete_spec.rb +++ b/spec/features/projects/milestones/gfm_autocomplete_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'GFM autocomplete', :js do +RSpec.describe 'GFM autocomplete', :js, feature_category: :team_planning do let_it_be(:user) { create(:user, name: '💃speciąl someone💃', username: 'someone.special') } let_it_be(:group) { create(:group, name: 'Ancestor') } let_it_be(:project) { create(:project, :repository, group: group) } diff --git a/spec/features/projects/milestones/milestone_spec.rb b/spec/features/projects/milestones/milestone_spec.rb index 6bd139c0ebe..73d46d3764e 100644 --- a/spec/features/projects/milestones/milestone_spec.rb +++ b/spec/features/projects/milestones/milestone_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project milestone', :js do +RSpec.describe 'Project milestone', :js, feature_category: :team_planning do let(:user) { create(:user) } let(:project) { create(:project, name: 'test', namespace: user.namespace) } let(:milestone) { create(:milestone, project: project) } diff --git a/spec/features/projects/milestones/milestones_sorting_spec.rb b/spec/features/projects/milestones/milestones_sorting_spec.rb index 5ba4289fd11..8a8e7d07435 100644 --- a/spec/features/projects/milestones/milestones_sorting_spec.rb +++ b/spec/features/projects/milestones/milestones_sorting_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Milestones sorting', :js do +RSpec.describe 'Milestones sorting', :js, feature_category: :team_planning do let(:user) { create(:user) } let(:project) { create(:project, name: 'test', namespace: user.namespace) } let(:milestones_for_sort_by) do diff --git a/spec/features/projects/milestones/new_spec.rb b/spec/features/projects/milestones/new_spec.rb index 170268297cd..ef9325a1627 100644 --- a/spec/features/projects/milestones/new_spec.rb +++ b/spec/features/projects/milestones/new_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Creating a new project milestone', :js do +RSpec.describe 'Creating a new project milestone', :js, feature_category: :team_planning do let(:user) { create(:user) } let(:project) { create(:project, name: 'test', namespace: user.namespace) } diff --git a/spec/features/projects/milestones/user_interacts_with_labels_spec.rb b/spec/features/projects/milestones/user_interacts_with_labels_spec.rb index d658599c52b..36dfee7811d 100644 --- a/spec/features/projects/milestones/user_interacts_with_labels_spec.rb +++ b/spec/features/projects/milestones/user_interacts_with_labels_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User interacts with labels' do +RSpec.describe 'User interacts with labels', feature_category: :team_planning do let(:user) { create(:user) } let(:project) { create(:project, namespace: user.namespace) } let(:milestone) { create(:milestone, project: project, title: 'v2.2', description: '# Description header') } diff --git a/spec/features/projects/navbar_spec.rb b/spec/features/projects/navbar_spec.rb index 5b5f7860e43..4d85b5cfb2e 100644 --- a/spec/features/projects/navbar_spec.rb +++ b/spec/features/projects/navbar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project navbar' do +RSpec.describe 'Project navbar', feature_category: :projects do include NavbarStructureHelper include WaitForRequests diff --git a/spec/features/projects/network_graph_spec.rb b/spec/features/projects/network_graph_spec.rb index 97b743b4d73..b36fde8a2bf 100644 --- a/spec/features/projects/network_graph_spec.rb +++ b/spec/features/projects/network_graph_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project Network Graph', :js do +RSpec.describe 'Project Network Graph', :js, feature_category: :projects do let(:user) { create :user } let(:project) { create :project, :repository, namespace: user.namespace } diff --git a/spec/features/projects/new_project_from_template_spec.rb b/spec/features/projects/new_project_from_template_spec.rb index 1c8647d859a..97304840010 100644 --- a/spec/features/projects/new_project_from_template_spec.rb +++ b/spec/features/projects/new_project_from_template_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'New project from template', :js do +RSpec.describe 'New project from template', :js, feature_category: :projects do let(:user) { create(:user) } before do diff --git a/spec/features/projects/new_project_spec.rb b/spec/features/projects/new_project_spec.rb index 7cf05242a23..769ad5bf61a 100644 --- a/spec/features/projects/new_project_spec.rb +++ b/spec/features/projects/new_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'New project', :js do +RSpec.describe 'New project', :js, feature_category: :projects do include Spec::Support::Helpers::Features::TopNavSpecHelpers context 'as a user' do diff --git a/spec/features/projects/package_files_spec.rb b/spec/features/projects/package_files_spec.rb index 6dc0294bb9e..824b57db7ad 100644 --- a/spec/features/projects/package_files_spec.rb +++ b/spec/features/projects/package_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'PackageFiles' do +RSpec.describe 'PackageFiles', feature_category: :projects do let(:user) { create(:user) } let(:project) { create(:project) } let!(:package) { create(:maven_package, project: project) } diff --git a/spec/features/projects/packages_spec.rb b/spec/features/projects/packages_spec.rb index bbe913cf1e5..31ff455d0df 100644 --- a/spec/features/projects/packages_spec.rb +++ b/spec/features/projects/packages_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Packages' do +RSpec.describe 'Packages', feature_category: :projects do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project) } diff --git a/spec/features/projects/pages/user_adds_domain_spec.rb b/spec/features/projects/pages/user_adds_domain_spec.rb index 5cb4fa163c8..708210e669c 100644 --- a/spec/features/projects/pages/user_adds_domain_spec.rb +++ b/spec/features/projects/pages/user_adds_domain_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -RSpec.describe 'User adds pages domain', :js do +RSpec.describe 'User adds pages domain', :js, feature_category: :pages do include LetsEncryptHelpers include Spec::Support::Helpers::ModalHelpers diff --git a/spec/features/projects/pages/user_configures_pages_pipeline_spec.rb b/spec/features/projects/pages/user_configures_pages_pipeline_spec.rb index 029479d6b95..baef75ca303 100644 --- a/spec/features/projects/pages/user_configures_pages_pipeline_spec.rb +++ b/spec/features/projects/pages/user_configures_pages_pipeline_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -RSpec.describe 'Pages edits pages settings', :js do +RSpec.describe 'Pages edits pages settings', :js, feature_category: :pages do include Spec::Support::Helpers::ModalHelpers let_it_be(:project) { create(:project, pages_https_only: false) } @@ -46,14 +46,14 @@ RSpec.describe 'Pages edits pages settings', :js do Feature.disable(:use_pipeline_wizard_for_pages) end + after do + Feature.enable(:use_pipeline_wizard_for_pages) + end + it 'shows configure pages instructions' do visit project_pages_path(project) expect(page).to have_content('Configure pages') end - - after do - Feature.enable(:use_pipeline_wizard_for_pages) - end end end diff --git a/spec/features/projects/pages/user_edits_lets_encrypt_settings_spec.rb b/spec/features/projects/pages/user_edits_lets_encrypt_settings_spec.rb index 2e28fa20b90..a7da59200e9 100644 --- a/spec/features/projects/pages/user_edits_lets_encrypt_settings_spec.rb +++ b/spec/features/projects/pages/user_edits_lets_encrypt_settings_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -RSpec.describe "Pages with Let's Encrypt", :https_pages_enabled do +RSpec.describe "Pages with Let's Encrypt", :https_pages_enabled, feature_category: :pages do include LetsEncryptHelpers include Spec::Support::Helpers::ModalHelpers diff --git a/spec/features/projects/pages/user_edits_settings_spec.rb b/spec/features/projects/pages/user_edits_settings_spec.rb index 88c27a6adf2..7ceefdecbae 100644 --- a/spec/features/projects/pages/user_edits_settings_spec.rb +++ b/spec/features/projects/pages/user_edits_settings_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -RSpec.describe 'Pages edits pages settings', :js do +RSpec.describe 'Pages edits pages settings', :js, feature_category: :pages do include Spec::Support::Helpers::ModalHelpers let_it_be_with_reload(:project) { create(:project, :pages_published, pages_https_only: false) } diff --git a/spec/features/projects/pipeline_schedules_spec.rb b/spec/features/projects/pipeline_schedules_spec.rb index e569fef76f8..8beb8af1a8e 100644 --- a/spec/features/projects/pipeline_schedules_spec.rb +++ b/spec/features/projects/pipeline_schedules_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Pipeline Schedules', :js do +RSpec.describe 'Pipeline Schedules', :js, feature_category: :projects do include Spec::Support::Helpers::ModalHelpers let!(:project) { create(:project, :repository) } @@ -64,7 +64,7 @@ RSpec.describe 'Pipeline Schedules', :js do it 'shows the pipeline schedule with default ref' do page.within('[data-testid="schedule-target-ref"]') do - expect(first('.gl-new-dropdown-button-text').text).to eq('master') + expect(first('.gl-dropdown-button-text').text).to eq('master') end end end @@ -77,7 +77,7 @@ RSpec.describe 'Pipeline Schedules', :js do it 'shows the pipeline schedule with default ref' do page.within('[data-testid="schedule-target-ref"]') do - expect(first('.gl-new-dropdown-button-text').text).to eq('master') + expect(first('.gl-dropdown-button-text').text).to eq('master') end end end diff --git a/spec/features/projects/pipelines/legacy_pipeline_spec.rb b/spec/features/projects/pipelines/legacy_pipeline_spec.rb deleted file mode 100644 index c4fc194f0cd..00000000000 --- a/spec/features/projects/pipelines/legacy_pipeline_spec.rb +++ /dev/null @@ -1,1315 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'Pipeline', :js do - include RoutesHelpers - include ProjectForksHelper - include ::ExclusiveLeaseHelpers - - let_it_be(:project) { create(:project) } - - let(:user) { create(:user) } - let(:role) { :developer } - - before do - sign_in(user) - project.add_role(user, role) - stub_feature_flags(pipeline_tabs_vue: false) - end - - shared_context 'pipeline builds' do - let!(:build_passed) do - create(:ci_build, :success, - pipeline: pipeline, stage: 'build', stage_idx: 0, name: 'build') - end - - let!(:build_failed) do - create(:ci_build, :failed, - pipeline: pipeline, stage: 'test', stage_idx: 1, name: 'test') - end - - let!(:build_preparing) do - create(:ci_build, :preparing, - pipeline: pipeline, stage: 'deploy', stage_idx: 2, name: 'prepare') - end - - let!(:build_running) do - create(:ci_build, :running, - pipeline: pipeline, stage: 'deploy', stage_idx: 3, name: 'deploy') - end - - let!(:build_manual) do - create(:ci_build, :manual, - pipeline: pipeline, stage: 'deploy', stage_idx: 3, name: 'manual-build') - end - - let!(:build_scheduled) do - create(:ci_build, :scheduled, - pipeline: pipeline, stage: 'deploy', stage_idx: 3, name: 'delayed-job') - end - - let!(:build_external) do - create(:generic_commit_status, status: 'success', - pipeline: pipeline, - name: 'jenkins', - stage: 'external', - ref: 'master', - target_url: 'http://gitlab.com/status') - end - end - - describe 'GET /:project/-/pipelines/:id' do - include_context 'pipeline builds' - - let_it_be(:group) { create(:group) } - let_it_be(:project, reload: true) { create(:project, :repository, group: group) } - - let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id, user: user) } - - subject(:visit_pipeline) { visit project_pipeline_path(project, pipeline) } - - it 'shows the pipeline graph' do - visit_pipeline - - expect(page).to have_selector('.js-pipeline-graph') - expect(page).to have_content('build') - expect(page).to have_content('test') - expect(page).to have_content('deploy') - expect(page).to have_content('Retry') - expect(page).to have_content('Cancel running') - 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}") - expect(page).to have_link(pipeline.ref, - href: project_commits_path(pipeline.project, pipeline.ref)) - end - end - - describe 'related merge requests' do - context 'when there are no related merge requests' do - it 'shows a "no related merge requests" message' do - visit_pipeline - - within '.related-merge-request-info' do - expect(page).to have_content('No related merge requests found.') - end - end - end - - context 'when there is one related merge request' do - let!(:merge_request) do - create(:merge_request, - source_project: project, - source_branch: pipeline.ref) - end - - it 'shows a link to the merge request' do - visit_pipeline - - within '.related-merge-requests' do - expect(page).to have_content('1 related merge request: ') - expect(page).to have_selector('.js-truncated-mr-list') - expect(page).to have_link("#{merge_request.to_reference} #{merge_request.title}") - - expect(page).not_to have_selector('.js-full-mr-list') - expect(page).not_to have_selector('.text-expander') - end - end - end - - context 'when there are two related merge requests' do - let!(:merge_request1) do - create(:merge_request, - source_project: project, - source_branch: pipeline.ref) - end - - let!(:merge_request2) do - create(:merge_request, - source_project: project, - source_branch: pipeline.ref, - target_branch: 'fix') - end - - it 'links to the most recent related merge request' do - visit_pipeline - - within '.related-merge-requests' do - expect(page).to have_content('2 related merge requests: ') - expect(page).to have_link("#{merge_request2.to_reference} #{merge_request2.title}") - expect(page).to have_selector('.text-expander') - expect(page).to have_selector('.js-full-mr-list', visible: false) - end - end - - it 'expands to show links to all related merge requests' do - visit_pipeline - - within '.related-merge-requests' do - find('.text-expander').click - - expect(page).to have_selector('.js-full-mr-list', visible: true) - - pipeline.all_merge_requests.map do |merge_request| - expect(page).to have_link(href: project_merge_request_path(project, merge_request)) - end - end - end - end - end - - describe 'pipelines details view' do - let!(:status) { create(:user_status, user: pipeline.user, emoji: 'smirk', message: 'Authoring this object') } - - it 'pipeline header shows the user status and emoji' do - visit project_pipeline_path(project, pipeline) - - within '[data-testid="ci-header-content"]' do - expect(page).to have_selector("[data-testid='#{status.message}']") - expect(page).to have_selector("[data-name='#{status.emoji}']") - end - end - 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 - expect(page).to have_selector('.js-ci-status-icon-running') - expect(page).to have_selector('.js-icon-cancel') - expect(page).to have_content('deploy') - end - end - - it 'cancels the running build and shows retry button', :sidekiq_might_not_need_inline do - find('#ci-badge-deploy .ci-action-icon-container').click - - page.within('#ci-badge-deploy') do - expect(page).to have_css('.js-icon-retry') - end - end - end - - context 'when pipeline has preparing builds' do - it 'shows a preparing icon and a cancel action' do - page.within('#ci-badge-prepare') do - expect(page).to have_selector('.js-ci-status-icon-preparing') - expect(page).to have_selector('.js-icon-cancel') - expect(page).to have_content('prepare') - end - end - - it 'cancels the preparing build and shows retry button', :sidekiq_might_not_need_inline do - find('#ci-badge-deploy .ci-action-icon-container').click - - page.within('#ci-badge-deploy') do - expect(page).to have_css('.js-icon-retry') - end - end - end - - context 'when pipeline has successful builds' do - it 'shows the success icon and a retry action for the successful build' do - page.within('#ci-badge-build') do - expect(page).to have_selector('.js-ci-status-icon-success') - expect(page).to have_content('build') - end - - page.within('#ci-badge-build .ci-action-icon-container.js-icon-retry') do - expect(page).to have_selector('svg') - end - end - - it 'is possible to retry the success job', :sidekiq_might_not_need_inline do - find('#ci-badge-build .ci-action-icon-container').click - wait_for_requests - - expect(page).not_to have_content('Retry job') - within('.js-pipeline-header-container') do - expect(page).to have_selector('.js-ci-status-icon-running') - end - end - end - - context 'when pipeline has a delayed job' do - let(:project) { create(:project, :repository, group: group) } - - it 'shows the scheduled icon and an unschedule action for the delayed job' do - page.within('#ci-badge-delayed-job') do - expect(page).to have_selector('.js-ci-status-icon-scheduled') - expect(page).to have_content('delayed-job') - end - - page.within('#ci-badge-delayed-job .ci-action-icon-container.js-icon-time-out') do - expect(page).to have_selector('svg') - end - end - - it 'unschedules the delayed job and shows play button as a manual job', :sidekiq_might_not_need_inline do - find('#ci-badge-delayed-job .ci-action-icon-container').click - - page.within('#ci-badge-delayed-job') do - expect(page).to have_css('.js-icon-play') - end - end - end - - context 'when pipeline has failed builds' do - it 'shows the failed icon and a retry action for the failed build' do - page.within('#ci-badge-test') do - expect(page).to have_selector('.js-ci-status-icon-failed') - expect(page).to have_content('test') - end - - page.within('#ci-badge-test .ci-action-icon-container.js-icon-retry') do - expect(page).to have_selector('svg') - end - end - - it 'is possible to retry the failed build', :sidekiq_might_not_need_inline do - find('#ci-badge-test .ci-action-icon-container').click - wait_for_requests - - expect(page).not_to have_content('Retry job') - within('.js-pipeline-header-container') do - expect(page).to have_selector('.js-ci-status-icon-running') - end - end - - it 'includes the failure reason' do - page.within('#ci-badge-test') do - build_link = page.find('.js-pipeline-graph-job-link') - expect(build_link['title']).to eq('test - failed - (unknown failure)') - end - end - end - - context 'when pipeline has manual jobs' do - it 'shows the skipped icon and a play action for the manual build' do - page.within('#ci-badge-manual-build') do - expect(page).to have_selector('.js-ci-status-icon-manual') - expect(page).to have_content('manual') - end - - page.within('#ci-badge-manual-build .ci-action-icon-container.js-icon-play') do - expect(page).to have_selector('svg') - end - end - - it 'is possible to play the manual job', :sidekiq_might_not_need_inline do - find('#ci-badge-manual-build .ci-action-icon-container').click - wait_for_requests - - expect(page).not_to have_content('Play job') - within('.js-pipeline-header-container') do - expect(page).to have_selector('.js-ci-status-icon-running') - end - end - end - - context 'when pipeline has external job' do - it 'shows the success icon and the generic comit status build' do - expect(page).to have_selector('.js-ci-status-icon-success') - expect(page).to have_content('jenkins') - expect(page).to have_link('jenkins', href: 'http://gitlab.com/status') - end - end - end - - context 'when the pipeline has manual stage' do - before do - create(:ci_build, :manual, pipeline: pipeline, stage_idx: 10, stage: 'publish', name: 'CentOS') - create(:ci_build, :manual, pipeline: pipeline, stage_idx: 10, stage: 'publish', name: 'Debian') - create(:ci_build, :manual, pipeline: pipeline, stage_idx: 10, stage: 'publish', name: 'OpenSUDE') - - # force to update stages statuses - Ci::ProcessPipelineService.new(pipeline).execute - - visit_pipeline - end - - it 'displays play all button' do - expect(page).to have_selector('.js-stage-action') - end - end - - context 'page tabs' do - before do - visit_pipeline - end - - it 'shows Pipeline, Jobs, DAG and Failed Jobs tabs with link' do - expect(page).to have_link('Pipeline') - expect(page).to have_link('Jobs') - expect(page).to have_link('Needs') - expect(page).to have_link('Failed Jobs') - end - - it 'shows counter in Jobs tab' do - expect(page.find('.js-builds-counter').text).to eq(pipeline.total_size.to_s) - end - - it 'shows Pipeline tab as active' do - expect(page).to have_css('.js-pipeline-tab-link .active') - end - - context 'without permission to access builds' do - let(:project) { create(:project, :public, :repository, public_builds: false) } - let(:role) { :guest } - - it 'does not show the pipeline details page' do - expect(page).to have_content('Not Found') - end - end - end - - describe 'test tabs' do - let(:pipeline) { create(:ci_pipeline, :with_test_reports, :with_report_results, project: project) } - - before do - stub_feature_flags(pipeline_tabs_vue: false) - visit_pipeline - wait_for_requests - 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 - - expect(page).to have_content('Jobs') - expect(page).to have_selector('[data-testid="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 - end - - context 'retrying jobs' do - before do - visit_pipeline - end - - it { expect(page).not_to have_content('retried') } - - context 'when retrying' do - before do - find('[data-testid="retryPipeline"]').click - wait_for_requests - end - - it 'does not show a "Retry" button', :sidekiq_might_not_need_inline do - expect(page).not_to have_content('Retry') - end - - it 'shows running status in pipeline header', :sidekiq_might_not_need_inline do - within('.js-pipeline-header-container') do - expect(page).to have_selector('.js-ci-status-icon-running') - end - end - end - end - - context 'canceling jobs' do - before do - visit_pipeline - end - - it { expect(page).not_to have_selector('.ci-canceled') } - - context 'when canceling' do - before do - click_on 'Cancel running' - end - - it 'does not show a "Cancel running" button', :sidekiq_might_not_need_inline do - expect(page).not_to have_content('Cancel running') - end - end - end - - context 'when user can not delete' do - before do - visit_pipeline - end - - it { expect(page).not_to have_button('Delete') } - end - - context 'when deleting' do - before do - group.add_owner(user) - - visit_pipeline - - click_button 'Delete' - click_button 'Delete pipeline' - end - - it 'redirects to pipeline overview page', :sidekiq_inline do - expect(page).to have_content('The pipeline has been deleted') - expect(page).to have_current_path(project_pipelines_path(project), ignore_query: true) - end - end - - context 'when pipeline ref does not exist in repository anymore' do - let(:pipeline) do - create(:ci_empty_pipeline, project: project, - ref: 'non-existent', - sha: project.commit.id, - 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) - end - - it 'does not render render raw HTML to the pipeline ref' do - page.within '.pipeline-info' do - expect(page).not_to have_content('<span class="ref-name"') - end - end - end - - context 'when pipeline is detached merge request pipeline' do - let(:source_project) { project } - let(:target_project) { project } - - let(:merge_request) do - create(:merge_request, - :with_detached_merge_request_pipeline, - source_project: source_project, - target_project: target_project) - end - - let(:pipeline) do - merge_request.all_pipelines.last - end - - it 'shows the pipeline information' do - visit_pipeline - - within '.pipeline-info' do - expect(page).to have_content("#{pipeline.statuses.count} jobs " \ - "for !#{merge_request.iid} " \ - "with #{merge_request.source_branch}") - expect(page).to have_link("!#{merge_request.iid}", - href: project_merge_request_path(project, merge_request)) - expect(page).to have_link(merge_request.source_branch, - href: project_commits_path(merge_request.source_project, merge_request.source_branch)) - end - end - - context 'when source branch does not exist' do - before do - project.repository.rm_branch(user, merge_request.source_branch) - end - - it 'does not link to the source branch commit path' do - visit_pipeline - - within '.pipeline-info' do - expect(page).not_to have_link(merge_request.source_branch) - expect(page).to have_content(merge_request.source_branch) - end - end - end - - context 'when source project is a forked project' do - let(:source_project) { fork_project(project, user, repository: true) } - - before do - visit project_pipeline_path(source_project, pipeline) - end - - it 'shows the pipeline information', :sidekiq_might_not_need_inline do - within '.pipeline-info' do - expect(page).to have_content("#{pipeline.statuses.count} jobs " \ - "for !#{merge_request.iid} " \ - "with #{merge_request.source_branch}") - expect(page).to have_link("!#{merge_request.iid}", - href: project_merge_request_path(project, merge_request)) - expect(page).to have_link(merge_request.source_branch, - href: project_commits_path(merge_request.source_project, merge_request.source_branch)) - end - end - end - end - - context 'when pipeline is merge request pipeline' do - let(:project) { create(:project, :repository, group: group) } - let(:source_project) { project } - let(:target_project) { project } - - let(:merge_request) do - create(:merge_request, - :with_merge_request_pipeline, - source_project: source_project, - target_project: target_project, - merge_sha: project.commit.id) - end - - let(:pipeline) do - merge_request.all_pipelines.last - end - - before do - pipeline.update!(user: user) - end - - it 'shows the pipeline information' do - visit_pipeline - - within '.pipeline-info' do - expect(page).to have_content("#{pipeline.statuses.count} jobs " \ - "for !#{merge_request.iid} " \ - "with #{merge_request.source_branch} " \ - "into #{merge_request.target_branch}") - expect(page).to have_link("!#{merge_request.iid}", - href: project_merge_request_path(project, merge_request)) - expect(page).to have_link(merge_request.source_branch, - href: project_commits_path(merge_request.source_project, merge_request.source_branch)) - expect(page).to have_link(merge_request.target_branch, - href: project_commits_path(merge_request.target_project, merge_request.target_branch)) - end - end - - context 'when target branch does not exist' do - before do - project.repository.rm_branch(user, merge_request.target_branch) - end - - it 'does not link to the target branch commit path' do - visit_pipeline - - within '.pipeline-info' do - expect(page).not_to have_link(merge_request.target_branch) - expect(page).to have_content(merge_request.target_branch) - end - end - end - - context 'when source project is a forked project' do - let(:source_project) { fork_project(project, user, repository: true) } - - before do - visit project_pipeline_path(source_project, pipeline) - end - - it 'shows the pipeline information', :sidekiq_might_not_need_inline do - within '.pipeline-info' do - expect(page).to have_content("#{pipeline.statuses.count} jobs " \ - "for !#{merge_request.iid} " \ - "with #{merge_request.source_branch} " \ - "into #{merge_request.target_branch}") - expect(page).to have_link("!#{merge_request.iid}", - href: project_merge_request_path(project, merge_request)) - expect(page).to have_link(merge_request.source_branch, - href: project_commits_path(merge_request.source_project, merge_request.source_branch)) - expect(page).to have_link(merge_request.target_branch, - href: project_commits_path(merge_request.target_project, merge_request.target_branch)) - end - end - end - end - end - - context 'when user does not have access to read jobs' do - before do - project.update!(public_builds: false) - end - - describe 'GET /:project/-/pipelines/:id' do - include_context 'pipeline builds' - - let_it_be(: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 - - it 'shows the pipeline graph' do - expect(page).to have_selector('.js-pipeline-graph') - expect(page).to have_content('build') - expect(page).to have_content('test') - expect(page).to have_content('deploy') - expect(page).to have_content('Retry') - expect(page).to have_content('Cancel running') - end - - it 'does not link to job' do - expect(page).not_to have_selector('.js-pipeline-graph-job-link') - end - end - end - - context 'when a bridge job exists' do - include_context 'pipeline builds' - - let(:project) { create(:project, :repository) } - let(:downstream) { create(:project, :repository) } - - let(:pipeline) do - create(:ci_pipeline, project: project, - ref: 'master', - sha: project.commit.id, - user: user) - end - - let!(:bridge) do - create(:ci_bridge, pipeline: pipeline, - name: 'cross-build', - user: user, - downstream: downstream) - end - - describe 'GET /:project/-/pipelines/:id' do - before do - visit project_pipeline_path(project, pipeline) - end - - it 'shows the pipeline with a bridge job' do - expect(page).to have_selector('.js-pipeline-graph') - expect(page).to have_content('cross-build') - end - - context 'when a scheduled pipeline is created by a blocked user' do - let(:project) { create(:project, :repository) } - - let(:schedule) do - create(:ci_pipeline_schedule, - project: project, - owner: project.first_owner, - description: 'blocked user schedule' - ).tap do |schedule| - schedule.update_column(:next_run_at, 1.minute.ago) - end - end - - before do - schedule.owner.block! - PipelineScheduleWorker.new.perform - end - - it 'displays the PipelineSchedule in an inactive state' do - stub_feature_flags(pipeline_schedules_vue: false) - - visit project_pipeline_schedules_path(project) - page.click_link('Inactive') - - expect(page).to have_selector('table.ci-table > tbody > tr > td', text: 'blocked user schedule') - end - - it 'does not create a new Pipeline' do - visit project_pipelines_path(project) - - expect(page).not_to have_selector('.ci-table') - expect(schedule.last_pipeline).to be_nil - end - end - end - - describe 'GET /:project/-/pipelines/:id/builds' do - before do - visit builds_project_pipeline_path(project, pipeline) - end - - it 'shows a bridge job on a list' do - expect(page).to have_content('cross-build') - expect(page).to have_content(bridge.id) - end - end - end - - context 'when build requires resource', :sidekiq_inline do - let_it_be(:project) { create(:project, :repository) } - - let(:pipeline) { create(:ci_pipeline, project: project) } - let(:resource_group) { create(:ci_resource_group, project: project) } - - let!(:test_job) do - create(:ci_build, :pending, stage: 'test', name: 'test', stage_idx: 1, pipeline: pipeline, project: project) - end - - let!(:deploy_job) do - create(:ci_build, :created, - stage: 'deploy', - name: 'deploy', - stage_idx: 2, - pipeline: pipeline, - project: project, - resource_group: resource_group) - end - - describe 'GET /:project/-/pipelines/:id' do - subject { visit project_pipeline_path(project, pipeline) } - - it 'shows deploy job as created' do - subject - - within('.js-pipeline-header-container') do - expect(page).to have_content('pending') - end - - within('.js-pipeline-graph') do - within(all('[data-testid="stage-column"]')[0]) do - expect(page).to have_content('test') - expect(page).to have_css('.ci-status-icon-pending') - end - - within(all('[data-testid="stage-column"]')[1]) do - expect(page).to have_content('deploy') - expect(page).to have_css('.ci-status-icon-created') - end - end - end - - context 'when test job succeeded' do - before do - test_job.success! - end - - it 'shows deploy job as pending' do - subject - - within('.js-pipeline-header-container') do - expect(page).to have_content('running') - end - - within('.js-pipeline-graph') do - within(all('[data-testid="stage-column"]')[0]) do - expect(page).to have_content('test') - expect(page).to have_css('.ci-status-icon-success') - end - - within(all('[data-testid="stage-column"]')[1]) do - expect(page).to have_content('deploy') - expect(page).to have_css('.ci-status-icon-pending') - end - end - end - end - - context 'when test job succeeded but there are no available resources' do - let(:another_job) { create(:ci_build, :running, project: project, resource_group: resource_group) } - - before do - resource_group.assign_resource_to(another_job) - test_job.success! - end - - it 'shows deploy job as waiting for resource' do - subject - - within('.js-pipeline-header-container') do - expect(page).to have_content('waiting') - end - - within('.js-pipeline-graph') do - within(all('[data-testid="stage-column"]')[1]) do - expect(page).to have_content('deploy') - expect(page).to have_css('.ci-status-icon-waiting-for-resource') - end - end - end - - context 'when resource is released from another job' do - before do - another_job.success! - end - - it 'shows deploy job as pending' do - subject - - within('.js-pipeline-header-container') do - expect(page).to have_content('running') - end - - within('.js-pipeline-graph') do - within(all('[data-testid="stage-column"]')[1]) do - expect(page).to have_content('deploy') - expect(page).to have_css('.ci-status-icon-pending') - end - end - end - end - - context 'when deploy job is a bridge to trigger a downstream pipeline' do - let!(:deploy_job) do - create(:ci_bridge, :created, - stage: 'deploy', - name: 'deploy', - stage_idx: 2, - pipeline: pipeline, - project: project, - resource_group: resource_group - ) - end - - it 'shows deploy job as waiting for resource' do - subject - - within('.js-pipeline-header-container') do - expect(page).to have_content('waiting') - end - - within('.js-pipeline-graph') do - within(all('[data-testid="stage-column"]')[1]) do - expect(page).to have_content('deploy') - expect(page).to have_css('.ci-status-icon-waiting-for-resource') - end - end - end - end - - context 'when deploy job is a bridge to trigger a downstream pipeline' do - let!(:deploy_job) do - create(:ci_bridge, :created, - stage: 'deploy', - name: 'deploy', - stage_idx: 2, - pipeline: pipeline, - project: project, - resource_group: resource_group - ) - end - - it 'shows deploy job as waiting for resource' do - subject - - within('.js-pipeline-header-container') do - expect(page).to have_content('waiting') - end - - within('.js-pipeline-graph') do - within(all('[data-testid="stage-column"]')[1]) do - expect(page).to have_content('deploy') - expect(page).to have_css('.ci-status-icon-waiting-for-resource') - end - end - end - end - end - end - end - - describe 'GET /:project/-/pipelines/:id/dag' do - include_context 'pipeline builds' - - let_it_be(:project) { create(:project, :repository) } - - let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id) } - - before do - visit dag_project_pipeline_path(project, pipeline) - end - - it 'shows DAG tab pane as active' do - expect(page).to have_css('#js-tab-dag.active', visible: false) - end - - context 'page tabs' do - it 'shows Pipeline, Jobs and DAG tabs with link' do - expect(page).to have_link('Pipeline') - expect(page).to have_link('Jobs') - expect(page).to have_link('DAG') - end - - it 'shows counter in Jobs tab' do - expect(page.find('.js-builds-counter').text).to eq(pipeline.total_size.to_s) - end - - it 'shows DAG tab as active' do - expect(page).to have_css('li.js-dag-tab-link .active') - end - end - end - - context 'when user sees pipeline flags in a pipeline detail page' do - let_it_be(:project) { create(:project, :repository) } - - context 'when pipeline is latest' do - include_context 'pipeline builds' - - let(:pipeline) do - create(:ci_pipeline, - project: project, - ref: 'master', - sha: project.commit.id, - user: user) - end - - before do - visit project_pipeline_path(project, pipeline) - end - - it 'contains badge that indicates it is the latest build' do - page.within(all('.well-segment')[1]) do - expect(page).to have_content 'latest' - end - end - end - - context 'when pipeline has configuration errors' do - let(:pipeline) do - create(:ci_pipeline, - :invalid, - project: project, - ref: 'master', - sha: project.commit.id, - user: user) - end - - before do - visit project_pipeline_path(project, pipeline) - end - - it 'contains badge that indicates errors' do - page.within(all('.well-segment')[1]) do - expect(page).to have_content 'yaml invalid' - end - end - - it 'contains badge with tooltip which contains error' do - expect(pipeline).to have_yaml_errors - - page.within(all('.well-segment')[1]) do - expect(page).to have_selector( - %Q{span[title="#{pipeline.yaml_errors}"]}) - end - end - - it 'contains badge that indicates failure reason' do - expect(page).to have_content 'error' - end - - it 'contains badge with tooltip which contains failure reason' do - expect(pipeline.failure_reason?).to eq true - - page.within(all('.well-segment')[1]) do - expect(page).to have_selector( - %Q{span[title="#{pipeline.present.failure_reason}"]}) - end - end - - it 'contains a pipeline header with title' do - expect(page).to have_content "Pipeline ##{pipeline.id}" - end - end - - context 'when pipeline is stuck' do - include_context 'pipeline builds' - - let(:pipeline) do - create(:ci_pipeline, - project: project, - ref: 'master', - sha: project.commit.id, - user: user) - end - - before do - create(:ci_build, :pending, pipeline: pipeline) - visit project_pipeline_path(project, pipeline) - end - - it 'contains badge that indicates being stuck' do - page.within(all('.well-segment')[1]) do - expect(page).to have_content 'stuck' - end - end - end - - context 'when pipeline uses auto devops' do - include_context 'pipeline builds' - - let(:project) { create(:project, :repository, auto_devops_attributes: { enabled: true }) } - let(:pipeline) do - create(:ci_pipeline, - :auto_devops_source, - project: project, - ref: 'master', - sha: project.commit.id, - user: user) - end - - before do - visit project_pipeline_path(project, pipeline) - end - - it 'contains badge that indicates using auto devops' do - page.within(all('.well-segment')[1]) do - expect(page).to have_content 'Auto DevOps' - end - end - end - - context 'when pipeline runs in a merge request context' do - include_context 'pipeline builds' - - let(:pipeline) do - create(:ci_pipeline, - source: :merge_request_event, - project: merge_request.source_project, - ref: 'feature', - sha: merge_request.diff_head_sha, - user: user, - merge_request: merge_request) - end - - let(:merge_request) do - create(:merge_request, - source_project: project, - source_branch: 'feature', - target_project: project, - target_branch: 'master') - end - - before do - visit project_pipeline_path(project, pipeline) - end - - it 'contains badge that indicates detached merge request pipeline' do - page.within(all('.well-segment')[1]) do - expect(page).to have_content 'merge request' - end - end - end - end - - describe 'GET /:project/-/pipelines/:id/builds' do - include_context 'pipeline builds' - - let_it_be(:project) { create(:project, :repository) } - - let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id) } - - before do - visit builds_project_pipeline_path(project, pipeline) - end - - it 'shows a list of jobs' do - expect(page).to have_content('Test') - expect(page).to have_content(build_passed.id) - expect(page).to have_content('Deploy') - expect(page).to have_content(build_failed.id) - expect(page).to have_content(build_running.id) - expect(page).to have_content(build_external.id) - expect(page).to have_content('Retry') - expect(page).to have_content('Cancel running') - expect(page).to have_button('Play') - end - - context 'page tabs' do - it 'shows Pipeline, Jobs and DAG tabs with link' do - expect(page).to have_link('Pipeline') - expect(page).to have_link('Jobs') - expect(page).to have_link('Needs') - end - - it 'shows counter in Jobs tab' do - expect(page.find('.js-builds-counter').text).to eq(pipeline.total_size.to_s) - end - end - - context 'retrying jobs' do - it { expect(page).not_to have_content('retried') } - - context 'when retrying' do - before do - find('[data-testid="retry"]', match: :first).click - end - - it 'does not show a "Retry" button', :sidekiq_might_not_need_inline do - expect(page).not_to have_content('Retry') - end - end - end - - context 'canceling jobs' do - it { expect(page).not_to have_selector('.ci-canceled') } - - context 'when canceling' do - before do - click_on 'Cancel running' - end - - it 'does not show a "Cancel running" button', :sidekiq_might_not_need_inline do - expect(page).not_to have_content('Cancel running') - end - end - end - - context 'playing manual job' do - before do - within '[data-testid="jobs-tab-table"]' do - click_button('Play') - - wait_for_requests - end - end - - it { expect(build_manual.reload).to be_pending } - end - - context 'when user unschedules a delayed job' do - before do - within '[data-testid="jobs-tab-table"]' do - click_button('Unschedule') - end - end - - it 'unschedules the delayed job and shows play button as a manual job' do - expect(page).to have_button('Play') - expect(page).not_to have_button('Unschedule') - end - end - end - - describe 'GET /:project/-/pipelines/:id/failures' do - let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: '1234') } - let(:pipeline_failures_page) { failures_project_pipeline_path(project, pipeline) } - let!(:failed_build) { create(:ci_build, :failed, pipeline: pipeline) } - - subject { visit pipeline_failures_page } - - context 'with failed build' do - before do - failed_build.trace.set('4 examples, 1 failure') - end - - it 'lists failed builds' do - subject - - expect(page).to have_content(failed_build.name) - expect(page).to have_content(failed_build.stage_name) - end - - it 'shows build failure logs' do - subject - - expect(page).to have_content('4 examples, 1 failure') - end - - it 'shows the failure reason' do - subject - - expect(page).to have_content('There is an unknown failure, please try again') - end - - context 'when user does not have permission to retry build' do - it 'shows retry button for failed build' do - subject - - page.within(find('#js-tab-failures', match: :first)) do - expect(page).not_to have_button('Retry') - end - end - end - - context 'when user does have permission to retry build' do - before do - create(:protected_branch, :developers_can_merge, - name: pipeline.ref, project: project) - end - - it 'shows retry button for failed build' do - subject - - page.within(find('#js-tab-failures', match: :first)) do - expect(page).to have_button('Retry') - end - end - end - end - - context 'when missing build logs' do - it 'lists failed builds' do - subject - - expect(page).to have_content(failed_build.name) - expect(page).to have_content(failed_build.stage_name) - end - - it 'does not show log' do - subject - - expect(page).to have_content('No job log') - end - end - - context 'without permission to access builds' do - let(:role) { :guest } - - before do - project.update!(public_builds: false) - end - - context 'when accessing failed jobs page' do - it 'renders a 404 page' do - requests = inspect_requests { subject } - - expect(page).to have_title('Not Found') - expect(requests.first.status_code).to eq(404) - end - end - end - - context 'without failures' do - before do - failed_build.update!(status: :success) - end - - it 'does not show the failure tab' do - subject - - expect(page).not_to have_content('Failed Jobs') - end - - it 'displays the pipeline graph' do - subject - - expect(page).to have_current_path(pipeline_path(pipeline), ignore_query: true) - expect(page).to have_selector('.js-pipeline-graph') - end - end - end -end diff --git a/spec/features/projects/pipelines/legacy_pipelines_spec.rb b/spec/features/projects/pipelines/legacy_pipelines_spec.rb deleted file mode 100644 index 9d3ac71a875..00000000000 --- a/spec/features/projects/pipelines/legacy_pipelines_spec.rb +++ /dev/null @@ -1,852 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'Pipelines', :js do - include ProjectForksHelper - include Spec::Support::Helpers::ModalHelpers - - let(:project) { create(:project) } - let(:expected_detached_mr_tag) { 'merge request' } - - context 'when user is logged in' do - let(:user) { create(:user) } - - before do - sign_in(user) - - project.add_developer(user) - project.update!(auto_devops_attributes: { enabled: false }) - - stub_feature_flags(pipeline_tabs_vue: false) - end - - describe 'GET /:project/-/pipelines' do - let(:project) { create(:project, :repository) } - - let!(:pipeline) do - create( - :ci_empty_pipeline, - project: project, - ref: 'master', - status: 'running', - sha: project.commit.id - ) - end - - context 'scope' do - before do - create(:ci_empty_pipeline, status: 'pending', project: project, sha: project.commit.id, ref: 'master') - create(:ci_empty_pipeline, status: 'running', project: project, sha: project.commit.id, ref: 'master') - create(:ci_empty_pipeline, status: 'created', project: project, sha: project.commit.id, ref: 'master') - create(:ci_empty_pipeline, status: 'success', project: project, sha: project.commit.id, ref: 'master') - end - - [:all, :running, :pending, :finished, :branches].each do |scope| - context "when displaying #{scope}" do - before do - visit_project_pipelines(scope: scope) - end - - it 'contains pipeline commit short SHA' do - expect(page).to have_content(pipeline.short_sha) - end - - it 'contains branch name' do - expect(page).to have_content(pipeline.ref) - end - end - end - end - - context 'header tabs' do - before do - visit project_pipelines_path(project) - wait_for_requests - end - - it 'shows a tab for All pipelines and count' do - expect(page.find('.js-pipelines-tab-all').text).to include('All') - expect(page.find('.js-pipelines-tab-all .badge').text).to include('1') - end - - it 'shows a tab for Finished pipelines and count' do - expect(page.find('.js-pipelines-tab-finished').text).to include('Finished') - end - - it 'shows a tab for Branches' do - expect(page.find('.js-pipelines-tab-branches').text).to include('Branches') - end - - it 'shows a tab for Tags' do - expect(page.find('.js-pipelines-tab-tags').text).to include('Tags') - end - - it 'updates content when tab is clicked' do - page.find('.js-pipelines-tab-finished').click - wait_for_requests - expect(page).to have_content('There are currently no finished pipelines.') - end - end - - context 'navigation links' do - before do - visit project_pipelines_path(project) - wait_for_requests - end - - it 'renders "CI lint" link' do - expect(page).to have_link('CI lint') - end - - it 'renders "Run pipeline" link' do - expect(page).to have_link('Run pipeline') - end - end - - context 'when pipeline is cancelable' do - let!(:build) do - create(:ci_build, pipeline: pipeline, - stage: 'test') - end - - before do - build.run - visit_project_pipelines - end - - it 'indicates that pipeline can be canceled' do - expect(page).to have_selector('.js-pipelines-cancel-button') - expect(page).to have_selector('.ci-running') - end - - context 'when canceling' do - before do - find('.js-pipelines-cancel-button').click - click_button 'Stop pipeline' - wait_for_requests - end - - it 'indicated that pipelines was canceled', :sidekiq_might_not_need_inline do - expect(page).not_to have_selector('.js-pipelines-cancel-button') - expect(page).to have_selector('.ci-canceled') - end - end - end - - context 'when pipeline is retryable', :sidekiq_might_not_need_inline do - let!(:build) do - create(:ci_build, pipeline: pipeline, - stage: 'test') - end - - before do - build.drop - visit_project_pipelines - end - - it 'indicates that pipeline can be retried' do - expect(page).to have_selector('.js-pipelines-retry-button') - expect(page).to have_selector('.ci-failed') - end - - context 'when retrying' do - before do - find('.js-pipelines-retry-button').click - wait_for_requests - end - - it 'shows running pipeline that is not retryable' do - expect(page).not_to have_selector('.js-pipelines-retry-button') - expect(page).to have_selector('.ci-running') - end - end - end - - context 'when pipeline is detached merge request pipeline' do - let(:merge_request) do - create(:merge_request, - :with_detached_merge_request_pipeline, - source_project: source_project, - target_project: target_project) - end - - let!(:pipeline) { merge_request.all_pipelines.first } - let(:source_project) { project } - let(:target_project) { project } - - before do - visit project_pipelines_path(source_project) - end - - shared_examples_for 'detached merge request pipeline' do - it 'shows pipeline information without pipeline ref', :sidekiq_might_not_need_inline do - within '.pipeline-tags' do - expect(page).to have_content(expected_detached_mr_tag) - - expect(page).to have_link(merge_request.iid, - href: project_merge_request_path(project, merge_request)) - - expect(page).not_to have_link(pipeline.ref) - end - end - end - - it_behaves_like 'detached merge request pipeline' - - context 'when source project is a forked project' do - let(:source_project) { fork_project(project, user, repository: true) } - - it_behaves_like 'detached merge request pipeline' - end - end - - context 'when pipeline is merge request pipeline' do - let(:merge_request) do - create(:merge_request, - :with_merge_request_pipeline, - source_project: source_project, - target_project: target_project, - merge_sha: target_project.commit.sha) - end - - let!(:pipeline) { merge_request.all_pipelines.first } - let(:source_project) { project } - let(:target_project) { project } - - before do - visit project_pipelines_path(source_project) - end - - shared_examples_for 'Correct merge request pipeline information' do - it 'does not show detached tag for the pipeline, and shows the link of the merge request' \ - 'and does not show the ref of the pipeline', :sidekiq_might_not_need_inline do - within '.pipeline-tags' do - expect(page).not_to have_content(expected_detached_mr_tag) - - expect(page).to have_link(merge_request.iid, - href: project_merge_request_path(project, merge_request)) - - expect(page).not_to have_link(pipeline.ref) - end - end - end - - it_behaves_like 'Correct merge request pipeline information' - - context 'when source project is a forked project' do - let(:source_project) { fork_project(project, user, repository: true) } - - it_behaves_like 'Correct merge request pipeline information' - end - end - - context 'when pipeline has configuration errors' do - let(:pipeline) do - create(:ci_pipeline, :invalid, project: project) - end - - before do - visit_project_pipelines - end - - it 'contains badge that indicates errors' do - expect(page).to have_content 'yaml invalid' - end - - it 'contains badge with tooltip which contains error' do - expect(pipeline).to have_yaml_errors - expect(page).to have_selector( - %Q{span[title="#{pipeline.yaml_errors}"]}) - end - - it 'contains badge that indicates failure reason' do - expect(page).to have_content 'error' - end - - it 'contains badge with tooltip which contains failure reason' do - expect(pipeline.failure_reason?).to eq true - expect(page).to have_selector( - %Q{span[title="#{pipeline.present.failure_reason}"]}) - end - end - - context 'with manual actions' do - let!(:manual) do - create(:ci_build, :manual, - pipeline: pipeline, - name: 'manual build', - stage: 'test') - end - - before do - visit_project_pipelines - end - - it 'has a dropdown with play button' do - expect(page).to have_selector('[data-testid="pipelines-manual-actions-dropdown"] [data-testid="play-icon"]') - end - - it 'has link to the manual action' do - find('[data-testid="pipelines-manual-actions-dropdown"]').click - - expect(page).to have_button('manual build') - end - - context 'when manual action was played' do - before do - find('[data-testid="pipelines-manual-actions-dropdown"]').click - click_button('manual build') - end - - it 'enqueues manual action job' do - expect(page).to have_selector( - '[data-testid="pipelines-manual-actions-dropdown"] .gl-dropdown-toggle:disabled' - ) - end - end - end - - context 'when there is a delayed job' do - let!(:delayed_job) do - create(:ci_build, :scheduled, - pipeline: pipeline, - name: 'delayed job 1', - stage: 'test') - end - - before do - visit_project_pipelines - end - - it 'has a dropdown for actionable jobs' do - expect(page).to have_selector('[data-testid="pipelines-manual-actions-dropdown"] [data-testid="play-icon"]') - end - - it "has link to the delayed job's action" do - find('[data-testid="pipelines-manual-actions-dropdown"]').click - - time_diff = [0, delayed_job.scheduled_at - Time.zone.now].max - expect(page).to have_button('delayed job 1') - expect(page).to have_content(Time.at(time_diff).utc.strftime("%H:%M:%S")) - end - - context 'when delayed job is expired already' do - let!(:delayed_job) do - create(:ci_build, :expired_scheduled, - pipeline: pipeline, - name: 'delayed job 1', - stage: 'test') - end - - it "shows 00:00:00 as the remaining time" do - find('[data-testid="pipelines-manual-actions-dropdown"]').click - - expect(page).to have_content("00:00:00") - end - end - - context 'when user played a delayed job immediately' do - before do - find('[data-testid="pipelines-manual-actions-dropdown"]').click - accept_gl_confirm do - click_button 'delayed job 1' - end - wait_for_requests - end - - it 'enqueues the delayed job', :js do - find('[data-testid="mini-pipeline-graph-dropdown"]').click - - within('[data-testid="mini-pipeline-graph-dropdown"]') { find('.ci-status-icon-pending') } - - expect(delayed_job.reload).to be_pending - end - end - end - - context 'for generic statuses' do - context 'when preparing' do - let!(:pipeline) do - create(:ci_empty_pipeline, - status: 'preparing', project: project) - end - - let!(:status) do - create(:generic_commit_status, - :preparing, pipeline: pipeline) - end - - before do - visit_project_pipelines - end - - it 'is cancelable' do - expect(page).to have_selector('.js-pipelines-cancel-button') - end - - it 'shows the pipeline as preparing' do - expect(page).to have_selector('.ci-preparing') - end - end - - context 'when running' do - let!(:running) do - create(:generic_commit_status, - status: 'running', - pipeline: pipeline, - stage: 'test') - end - - before do - visit_project_pipelines - end - - it 'is cancelable' do - expect(page).to have_selector('.js-pipelines-cancel-button') - end - - it 'has pipeline running' do - expect(page).to have_selector('.ci-running') - end - - context 'when canceling' do - before do - find('.js-pipelines-cancel-button').click - click_button 'Stop pipeline' - end - - it 'indicates that pipeline was canceled', :sidekiq_might_not_need_inline do - expect(page).not_to have_selector('.js-pipelines-cancel-button') - expect(page).to have_selector('.ci-canceled') - end - end - end - - context 'when failed' do - let!(:status) do - create(:generic_commit_status, :pending, - pipeline: pipeline, - stage: 'test') - end - - before do - status.drop - visit_project_pipelines - end - - it 'is not retryable' do - expect(page).not_to have_selector('.js-pipelines-retry-button') - end - - it 'has failed pipeline', :sidekiq_might_not_need_inline do - expect(page).to have_selector('.ci-failed') - end - end - end - - context 'downloadable pipelines' do - context 'with artifacts' do - let!(:with_artifacts) do - build = create(:ci_build, :success, - pipeline: pipeline, - name: 'rspec tests', - stage: 'test') - - create(:ci_job_artifact, :codequality, job: build) - end - - before do - visit_project_pipelines - end - - it 'has artifacts dropdown' do - expect(page).to have_selector('[data-testid="pipeline-multi-actions-dropdown"]') - end - end - - context 'with artifacts expired' do - let!(:with_artifacts_expired) do - create(:ci_build, :expired, :success, - pipeline: pipeline, - name: 'rspec', - stage: 'test') - end - - before do - visit_project_pipelines - end - - it { expect(page).not_to have_selector('[data-testid="artifact-item"]') } - end - - context 'without artifacts' do - let!(:without_artifacts) do - create(:ci_build, :success, - pipeline: pipeline, - name: 'rspec', - stage: 'test') - end - - before do - visit_project_pipelines - end - - it { expect(page).not_to have_selector('[data-testid="artifact-item"]') } - end - - context 'with trace artifact' do - before do - create(:ci_build, :success, :trace_artifact, pipeline: pipeline) - - visit_project_pipelines - end - - it 'does not show trace artifact as artifacts' do - expect(page).not_to have_selector('[data-testid="artifact-item"]') - end - end - end - - context 'mini pipeline graph' do - let!(:build) do - create(:ci_build, :pending, pipeline: pipeline, - stage: 'build', - name: 'build') - end - - dropdown_selector = '[data-testid="mini-pipeline-graph-dropdown"]' - - before do - visit_project_pipelines - end - - it 'renders a mini pipeline graph' do - expect(page).to have_selector('[data-testid="pipeline-mini-graph"]') - expect(page).to have_selector(dropdown_selector) - end - - context 'when clicking a stage badge' do - it 'opens a dropdown' do - find(dropdown_selector).click - - expect(page).to have_link build.name - end - - it 'is possible to cancel pending build' do - find(dropdown_selector).click - find('.js-ci-action').click - wait_for_requests - - expect(build.reload).to be_canceled - end - end - - context 'for a failed pipeline' do - let!(:build) do - create(:ci_build, :failed, pipeline: pipeline, - stage: 'build', - name: 'build') - end - - it 'displays the failure reason' do - find(dropdown_selector).click - - within('.js-builds-dropdown-list') do - build_element = page.find('.mini-pipeline-graph-dropdown-item') - expect(build_element['title']).to eq('build - failed - (unknown failure)') - end - end - end - end - - context 'with pagination' do - before do - allow(Ci::Pipeline).to receive(:default_per_page).and_return(1) - create(:ci_empty_pipeline, project: project) - end - - it 'renders pagination' do - visit project_pipelines_path(project) - wait_for_requests - - expect(page).to have_selector('.gl-pagination') - end - - it 'renders second page of pipelines' do - visit project_pipelines_path(project, page: '2') - wait_for_requests - - expect(page).to have_selector('.gl-pagination .page-link', count: 4) - end - - it 'shows updated content' do - visit project_pipelines_path(project) - wait_for_requests - page.find('.page-link.next-page-item').click - - expect(page).to have_selector('.gl-pagination .page-link', count: 4) - end - end - - context 'with pipeline key selection' do - before do - visit project_pipelines_path(project) - wait_for_requests - end - - it 'changes the Pipeline ID column for Pipeline IID' do - page.find('[data-testid="pipeline-key-dropdown"]').click - - within '.gl-new-dropdown-contents' do - dropdown_options = page.find_all '.gl-new-dropdown-item' - - dropdown_options[1].click - end - - expect(page.find('[data-testid="pipeline-th"]')).to have_content 'Pipeline' - expect(page.find('[data-testid="pipeline-url-link"]')).to have_content "##{pipeline.iid}" - end - end - end - - describe 'GET /:project/-/pipelines/show' do - let(:project) { create(:project, :repository) } - - let(:pipeline) do - create(:ci_empty_pipeline, - project: project, - sha: project.commit.id, - user: user) - end - - before do - create_build('build', 0, 'build', :success) - create_build('test', 1, 'rspec 0:2', :pending) - create_build('test', 1, 'rspec 1:2', :running) - create_build('test', 1, 'spinach 0:2', :created) - create_build('test', 1, 'spinach 1:2', :created) - create_build('test', 1, 'audit', :created) - create_build('deploy', 2, 'production', :created) - - create( - :generic_commit_status, - pipeline: pipeline, - stage: 'external', - name: 'jenkins', - stage_idx: 3, - ref: 'master' - ) - - visit project_pipeline_path(project, pipeline) - wait_for_requests - end - - it 'shows a graph with grouped stages' do - expect(page).to have_css('.js-pipeline-graph') - - # header - expect(page).to have_text("##{pipeline.id}") - expect(page).to have_selector(%Q(img[src="#{pipeline.user.avatar_url}"])) - expect(page).to have_link(pipeline.user.name, href: user_path(pipeline.user)) - - # stages - expect(page).to have_text('build') - expect(page).to have_text('test') - expect(page).to have_text('deploy') - expect(page).to have_text('external') - - # builds - expect(page).to have_text('rspec') - expect(page).to have_text('spinach') - expect(page).to have_text('rspec') - expect(page).to have_text('production') - expect(page).to have_text('jenkins') - end - - def create_build(stage, stage_idx, name, status) - create(:ci_build, pipeline: pipeline, stage: stage, stage_idx: stage_idx, name: name, status: status) - end - end - - describe 'POST /:project/-/pipelines' do - let(:project) { create(:project, :repository) } - - before do - stub_feature_flags(run_pipeline_graphql: false) - visit new_project_pipeline_path(project) - end - - context 'for valid commit', :js do - before do - click_button project.default_branch - wait_for_requests - - find('p', text: 'master').click - wait_for_requests - end - - context 'with gitlab-ci.yml', :js do - before do - stub_ci_pipeline_to_return_yaml_file - end - - it 'creates a new pipeline' do - expect do - click_on 'Run pipeline' - wait_for_requests - end - .to change { Ci::Pipeline.count }.by(1) - - expect(Ci::Pipeline.last).to be_web - end - - context 'when variables are specified' do - it 'creates a new pipeline with variables' do - page.within(find("[data-testid='ci-variable-row']")) do - find("[data-testid='pipeline-form-ci-variable-key']").set('key_name') - find("[data-testid='pipeline-form-ci-variable-value']").set('value') - end - - expect do - click_on 'Run pipeline' - wait_for_requests - end - .to change { Ci::Pipeline.count }.by(1) - - expect(Ci::Pipeline.last.variables.map { |var| var.slice(:key, :secret_value) }) - .to eq [{ key: "key_name", secret_value: "value" }.with_indifferent_access] - end - end - end - - context 'without gitlab-ci.yml' do - before do - click_on 'Run pipeline' - wait_for_requests - end - - it { expect(page).to have_content('Missing CI config file') } - - it 'creates a pipeline after first request failed and a valid gitlab-ci.yml file' \ - 'is available when trying again' do - stub_ci_pipeline_to_return_yaml_file - - expect do - click_on 'Run pipeline' - wait_for_requests - end - .to change { Ci::Pipeline.count }.by(1) - end - end - end - end - - describe 'Reset runner caches' do - let(:project) { create(:project, :repository) } - - before do - create(:ci_empty_pipeline, status: 'success', project: project, sha: project.commit.id, ref: 'master') - project.add_maintainer(user) - visit project_pipelines_path(project) - end - - it 'has a clear caches button' do - expect(page).to have_button 'Clear runner caches' - end - - describe 'user clicks the button' do - context 'when project already has jobs_cache_index' do - before do - project.update!(jobs_cache_index: 1) - end - - it 'increments jobs_cache_index' do - click_button 'Clear runner caches' - wait_for_requests - expect(page.find('[data-testid="alert-info"]')).to have_content 'Project cache successfully reset.' - end - end - - context 'when project does not have jobs_cache_index' do - it 'sets jobs_cache_index to 1' do - click_button 'Clear runner caches' - wait_for_requests - expect(page.find('[data-testid="alert-info"]')).to have_content 'Project cache successfully reset.' - end - end - end - end - - describe 'Run Pipelines' do - let(:project) { create(:project, :repository) } - - before do - visit new_project_pipeline_path(project) - end - - describe 'new pipeline page' do - it 'has field to add a new pipeline' do - expect(page).to have_selector('[data-testid="ref-select"]') - expect(find('[data-testid="ref-select"]')).to have_content project.default_branch - expect(page).to have_content('Run for') - end - end - - describe 'find pipelines' do - it 'shows filtered pipelines', :js do - click_button project.default_branch - - page.within '[data-testid="ref-select"]' do - find('[data-testid="search-refs"]').native.send_keys('fix') - - page.within '.gl-new-dropdown-contents' do - expect(page).to have_content('fix') - end - end - end - end - end - - describe 'Empty State' do - let(:project) { create(:project, :repository) } - - before do - visit project_pipelines_path(project) - end - - it 'renders empty state' do - expect(page).to have_content 'Try test template' - end - end - end - - context 'when user is not logged in' do - before do - project.update!(auto_devops_attributes: { enabled: false }) - visit project_pipelines_path(project) - end - - context 'when project is public' do - let(:project) { create(:project, :public, :repository) } - - context 'without pipelines' do - it { expect(page).to have_content 'This project is not currently set up to run pipelines.' } - end - end - - context 'when project is private' do - let(:project) { create(:project, :private, :repository) } - - it 'redirects the user to sign_in and displays the flash alert' do - expect(page).to have_content 'You need to sign in' - expect(page).to have_current_path("/users/sign_in") - end - end - end - - def visit_project_pipelines(**query) - visit project_pipelines_path(project, query) - wait_for_requests - end -end diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index 2d729af513a..d6067e22952 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Pipeline', :js do +RSpec.describe 'Pipeline', :js, feature_category: :projects do include RoutesHelpers include ProjectForksHelper include ::ExclusiveLeaseHelpers diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb index b7b715cb6db..3bdabd672c7 100644 --- a/spec/features/projects/pipelines/pipelines_spec.rb +++ b/spec/features/projects/pipelines/pipelines_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Pipelines', :js do +RSpec.describe 'Pipelines', :js, feature_category: :projects do include ProjectForksHelper include Spec::Support::Helpers::ModalHelpers @@ -596,8 +596,8 @@ RSpec.describe 'Pipelines', :js do it 'changes the Pipeline ID column for Pipeline IID' do page.find('[data-testid="pipeline-key-dropdown"]').click - within '.gl-new-dropdown-contents' do - dropdown_options = page.find_all '.gl-new-dropdown-item' + within '.gl-dropdown-contents' do + dropdown_options = page.find_all '.gl-dropdown-item' dropdown_options[1].click end @@ -663,7 +663,19 @@ RSpec.describe 'Pipelines', :js do describe 'POST /:project/-/pipelines' do let(:project) { create(:project, :repository) } - shared_examples 'run pipeline form with gitlab-ci.yml' do + before do + visit new_project_pipeline_path(project) + end + + context 'for valid commit', :js do + before do + click_button project.default_branch + wait_for_requests + + find('p', text: 'master').click + wait_for_requests + end + context 'with gitlab-ci.yml', :js do before do stub_ci_pipeline_to_return_yaml_file @@ -680,7 +692,7 @@ RSpec.describe 'Pipelines', :js do end context 'when variables are specified' do - it 'creates a new pipeline with variables' do + it 'creates a new pipeline with variables', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/375552' do page.within(find("[data-testid='ci-variable-row']")) do find("[data-testid='pipeline-form-ci-variable-key']").set('key_name') find("[data-testid='pipeline-form-ci-variable-value']").set('value') @@ -697,9 +709,7 @@ RSpec.describe 'Pipelines', :js do end end end - end - shared_examples 'run pipeline form without gitlab-ci.yml' do context 'without gitlab-ci.yml' do before do click_on 'Run pipeline' @@ -708,7 +718,7 @@ RSpec.describe 'Pipelines', :js do it { expect(page).to have_content('Missing CI config file') } - it 'creates a pipeline after first request failed and a valid gitlab-ci.yml file is available when trying again' do + it 'creates a pipeline after first request failed and a valid gitlab-ci.yml file is available when trying again', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/375552' do stub_ci_pipeline_to_return_yaml_file expect do @@ -719,52 +729,6 @@ RSpec.describe 'Pipelines', :js do end end end - - # Run Pipeline form with REST endpoints - # TODO: Clean up tests when run_pipeline_graphql is enabled - # Issue https://gitlab.com/gitlab-org/gitlab/-/issues/372310 - context 'with feature flag disabled' do - before do - stub_feature_flags(run_pipeline_graphql: false) - visit new_project_pipeline_path(project) - end - - context 'for valid commit', :js do - before do - click_button project.default_branch - wait_for_requests - - find('p', text: 'master').click - wait_for_requests - end - - it_behaves_like 'run pipeline form with gitlab-ci.yml' - - it_behaves_like 'run pipeline form without gitlab-ci.yml' - end - end - - # Run Pipeline form with GraphQL - context 'with feature flag enabled' do - before do - stub_feature_flags(run_pipeline_graphql: true) - visit new_project_pipeline_path(project) - end - - context 'for valid commit', :js do - before do - click_button project.default_branch - wait_for_requests - - find('p', text: 'master').click - wait_for_requests - end - - it_behaves_like 'run pipeline form with gitlab-ci.yml' - - it_behaves_like 'run pipeline form without gitlab-ci.yml' - end - end end describe 'Reset runner caches' do @@ -825,7 +789,7 @@ RSpec.describe 'Pipelines', :js do page.within '[data-testid="ref-select"]' do find('[data-testid="search-refs"]').native.send_keys('fix') - page.within '.gl-new-dropdown-contents' do + page.within '.gl-dropdown-contents' do expect(page).to have_content('fix') end end diff --git a/spec/features/projects/raw/user_interacts_with_raw_endpoint_spec.rb b/spec/features/projects/raw/user_interacts_with_raw_endpoint_spec.rb index 6745eb1a3fb..fb7814285b8 100644 --- a/spec/features/projects/raw/user_interacts_with_raw_endpoint_spec.rb +++ b/spec/features/projects/raw/user_interacts_with_raw_endpoint_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Raw > User interacts with raw endpoint' do +RSpec.describe 'Projects > Raw > User interacts with raw endpoint', feature_category: :projects do include RepoHelpers let(:user) { create(:user) } diff --git a/spec/features/projects/releases/user_creates_release_spec.rb b/spec/features/projects/releases/user_creates_release_spec.rb index 4eb7581222e..f678d77b002 100644 --- a/spec/features/projects/releases/user_creates_release_spec.rb +++ b/spec/features/projects/releases/user_creates_release_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User creates release', :js do +RSpec.describe 'User creates release', :js, feature_category: :continuous_delivery do include Spec::Support::Helpers::Features::ReleasesHelpers let_it_be(:project) { create(:project, :repository) } diff --git a/spec/features/projects/releases/user_views_edit_release_spec.rb b/spec/features/projects/releases/user_views_edit_release_spec.rb index 78b9798941a..ef3b35837ff 100644 --- a/spec/features/projects/releases/user_views_edit_release_spec.rb +++ b/spec/features/projects/releases/user_views_edit_release_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User edits Release', :js do +RSpec.describe 'User edits Release', :js, feature_category: :continuous_delivery do let_it_be(:project) { create(:project, :repository) } let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/releases/user_views_release_spec.rb b/spec/features/projects/releases/user_views_release_spec.rb index 4410f345e56..efa0ebd761d 100644 --- a/spec/features/projects/releases/user_views_release_spec.rb +++ b/spec/features/projects/releases/user_views_release_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User views Release', :js do +RSpec.describe 'User views Release', :js, feature_category: :continuous_delivery do let(:project) { create(:project, :repository) } let(:user) { create(:user) } diff --git a/spec/features/projects/releases/user_views_releases_spec.rb b/spec/features/projects/releases/user_views_releases_spec.rb index 10418e8072d..13dde57d885 100644 --- a/spec/features/projects/releases/user_views_releases_spec.rb +++ b/spec/features/projects/releases/user_views_releases_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User views releases', :js do +RSpec.describe 'User views releases', :js, feature_category: :continuous_delivery do let_it_be(:today) { Time.zone.now } let_it_be(:yesterday) { today - 1.day } let_it_be(:tomorrow) { today + 1.day } diff --git a/spec/features/projects/remote_mirror_spec.rb b/spec/features/projects/remote_mirror_spec.rb index 2c8e895d43d..aa0c1ead4c0 100644 --- a/spec/features/projects/remote_mirror_spec.rb +++ b/spec/features/projects/remote_mirror_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project remote mirror', :feature do +RSpec.describe 'Project remote mirror', :feature, feature_category: :projects do let(:project) { create(:project, :repository, :remote_mirror) } let(:remote_mirror) { project.remote_mirrors.first } let(:user) { create(:user) } diff --git a/spec/features/projects/settings/access_tokens_spec.rb b/spec/features/projects/settings/access_tokens_spec.rb index 88f9a50b093..12e14f5193f 100644 --- a/spec/features/projects/settings/access_tokens_spec.rb +++ b/spec/features/projects/settings/access_tokens_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project > Settings > Access Tokens', :js do +RSpec.describe 'Project > Settings > Access Tokens', :js, feature_category: :credential_management do include Spec::Support::Helpers::ModalHelpers let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/settings/branch_names_settings_spec.rb b/spec/features/projects/settings/branch_names_settings_spec.rb index fdd883bc2b6..5d82dff1efd 100644 --- a/spec/features/projects/settings/branch_names_settings_spec.rb +++ b/spec/features/projects/settings/branch_names_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project settings > repositories > Branch names', :js do +RSpec.describe 'Project settings > repositories > Branch names', :js, feature_category: :projects do let_it_be(:project) { create(:project, :public) } let(:user) { create(:user) } diff --git a/spec/features/projects/settings/branch_rules_settings_spec.rb b/spec/features/projects/settings/branch_rules_settings_spec.rb index 5cc35f108b5..71d9c559b77 100644 --- a/spec/features/projects/settings/branch_rules_settings_spec.rb +++ b/spec/features/projects/settings/branch_rules_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > Repository > Branch rules settings' do +RSpec.describe 'Projects > Settings > Repository > Branch rules settings', feature_category: :projects do let(:project) { create(:project_empty_repo) } let(:user) { create(:user) } let(:role) { :developer } diff --git a/spec/features/projects/settings/external_authorization_service_settings_spec.rb b/spec/features/projects/settings/external_authorization_service_settings_spec.rb index c236c85b773..a99fd5f9788 100644 --- a/spec/features/projects/settings/external_authorization_service_settings_spec.rb +++ b/spec/features/projects/settings/external_authorization_service_settings_spec.rb @@ -2,7 +2,8 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > External Authorization Classification Label setting' do +RSpec.describe 'Projects > Settings > External Authorization Classification Label setting', +feature_category: :projects do let(:user) { create(:user) } let(:project) { create(:project_empty_repo) } diff --git a/spec/features/projects/settings/forked_project_settings_spec.rb b/spec/features/projects/settings/forked_project_settings_spec.rb index 04fb6953b51..28d5c080db9 100644 --- a/spec/features/projects/settings/forked_project_settings_spec.rb +++ b/spec/features/projects/settings/forked_project_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > For a forked project', :js do +RSpec.describe 'Projects > Settings > For a forked project', :js, feature_category: :projects do include ProjectForksHelper let(:user) { create(:user) } let(:original_project) { create(:project) } diff --git a/spec/features/projects/settings/lfs_settings_spec.rb b/spec/features/projects/settings/lfs_settings_spec.rb index 6e1be3c7e51..1695b49830d 100644 --- a/spec/features/projects/settings/lfs_settings_spec.rb +++ b/spec/features/projects/settings/lfs_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > LFS settings' do +RSpec.describe 'Projects > Settings > LFS settings', feature_category: :projects do let(:project) { create(:project) } let(:user) { create(:user) } let(:role) { :maintainer } diff --git a/spec/features/projects/settings/merge_requests_settings_spec.rb b/spec/features/projects/settings/merge_requests_settings_spec.rb index ba84d8b6d1a..ca90817b0a4 100644 --- a/spec/features/projects/settings/merge_requests_settings_spec.rb +++ b/spec/features/projects/settings/merge_requests_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > Merge requests' do +RSpec.describe 'Projects > Settings > Merge requests', feature_category: :projects do include ProjectForksHelper let(:user) { create(:user) } diff --git a/spec/features/projects/settings/monitor_settings_spec.rb b/spec/features/projects/settings/monitor_settings_spec.rb index 871391fbe9c..2cdcf86757e 100644 --- a/spec/features/projects/settings/monitor_settings_spec.rb +++ b/spec/features/projects/settings/monitor_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > For a forked project', :js do +RSpec.describe 'Projects > Settings > For a forked project', :js, feature_category: :projects do let_it_be(:project) { create(:project, :repository, create_templates: :issue) } let(:user) { project.first_owner } diff --git a/spec/features/projects/settings/packages_settings_spec.rb b/spec/features/projects/settings/packages_settings_spec.rb index 1c2b0faa215..4ef17830f81 100644 --- a/spec/features/projects/settings/packages_settings_spec.rb +++ b/spec/features/projects/settings/packages_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > Packages', :js do +RSpec.describe 'Projects > Settings > Packages', :js, feature_category: :projects do let_it_be(:project) { create(:project) } let(:user) { project.first_owner } @@ -33,6 +33,10 @@ RSpec.describe 'Projects > Settings > Packages', :js do it 'displays the packages access level setting' do expect(page).to have_selector('[data-testid="package-registry-access-level"] > label', text: 'Package registry') + expect(page).to have_selector('input[name="package_registry_enabled"]', visible: false) + expect(page).to have_selector('input[name="package_registry_enabled"] + button', visible: true) + expect(page).to have_selector('input[name="package_registry_api_for_everyone_enabled"]', visible: false) + expect(page).to have_selector('input[name="package_registry_api_for_everyone_enabled"] + button', visible: true) expect(page).to have_selector( 'input[name="project[project_feature_attributes][package_registry_access_level]"]', visible: false diff --git a/spec/features/projects/settings/pipelines_settings_spec.rb b/spec/features/projects/settings/pipelines_settings_spec.rb index a64f81430d1..37973c9b8d6 100644 --- a/spec/features/projects/settings/pipelines_settings_spec.rb +++ b/spec/features/projects/settings/pipelines_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe "Projects > Settings > Pipelines settings" do +RSpec.describe "Projects > Settings > Pipelines settings", feature_category: :projects do let(:project) { create(:project) } let(:user) { create(:user) } let(:role) { :developer } @@ -165,7 +165,7 @@ RSpec.describe "Projects > Settings > Pipelines settings" do let(:page_token) { find('#registration_token').text } before do - click_button 'Reset registration token' + click_link 'Reset registration token' end it 'changes registration token' do diff --git a/spec/features/projects/settings/project_badges_spec.rb b/spec/features/projects/settings/project_badges_spec.rb index 2c26168e3c0..f4c2265c2c2 100644 --- a/spec/features/projects/settings/project_badges_spec.rb +++ b/spec/features/projects/settings/project_badges_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project Badges' do +RSpec.describe 'Project Badges', feature_category: :projects do include WaitForRequests let(:user) { create(:user) } diff --git a/spec/features/projects/settings/project_settings_spec.rb b/spec/features/projects/settings/project_settings_spec.rb index a0d44b579a8..46a41cfc6f1 100644 --- a/spec/features/projects/settings/project_settings_spec.rb +++ b/spec/features/projects/settings/project_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects settings' do +RSpec.describe 'Projects settings', feature_category: :projects do let_it_be(:project) { create(:project) } let(:user) { project.first_owner } diff --git a/spec/features/projects/settings/registry_settings_cleanup_tags_spec.rb b/spec/features/projects/settings/registry_settings_cleanup_tags_spec.rb index 477c4c2e1ba..d4c1fe4d43e 100644 --- a/spec/features/projects/settings/registry_settings_cleanup_tags_spec.rb +++ b/spec/features/projects/settings/registry_settings_cleanup_tags_spec.rb @@ -2,7 +2,8 @@ require 'spec_helper' -RSpec.describe 'Project > Settings > Packages and registries > Container registry tag expiration policy' do +RSpec.describe 'Project > Settings > Packages and registries > Container registry tag expiration policy', +feature_category: :projects do let_it_be(:user) { create(:user) } let_it_be(:project, reload: true) { create(:project, namespace: user.namespace) } diff --git a/spec/features/projects/settings/registry_settings_spec.rb b/spec/features/projects/settings/registry_settings_spec.rb index d64570cd5cc..072b5f7f3b0 100644 --- a/spec/features/projects/settings/registry_settings_spec.rb +++ b/spec/features/projects/settings/registry_settings_spec.rb @@ -2,7 +2,8 @@ require 'spec_helper' -RSpec.describe 'Project > Settings > Packages and registries > Container registry tag expiration policy' do +RSpec.describe 'Project > Settings > Packages and registries > Container registry tag expiration policy', +feature_category: :projects do let_it_be(:user) { create(:user) } let_it_be(:project, reload: true) { create(:project, namespace: user.namespace) } diff --git a/spec/features/projects/settings/repository_settings_spec.rb b/spec/features/projects/settings/repository_settings_spec.rb index d73ff0284cd..6f0a3094849 100644 --- a/spec/features/projects/settings/repository_settings_spec.rb +++ b/spec/features/projects/settings/repository_settings_spec.rb @@ -2,12 +2,13 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > Repository settings' do +RSpec.describe 'Projects > Settings > Repository settings', feature_category: :projects do let(:project) { create(:project_empty_repo) } let(:user) { create(:user) } let(:role) { :developer } before do + stub_feature_flags(branch_rules: false) project.add_role(user, role) sign_in(user) end @@ -39,19 +40,18 @@ RSpec.describe 'Projects > Settings > Repository settings' do end context 'Branch rules', :js do - it 'renders branch rules settings' do - visit project_settings_repository_path(project) - expect(page).to have_content('Branch rules') - end - context 'branch_rules feature flag disabled', :js do it 'does not render branch rules settings' do - stub_feature_flags(branch_rules: false) visit project_settings_repository_path(project) - expect(page).not_to have_content('Branch rules') end end + + it 'renders branch rules settings' do + stub_feature_flags(branch_rules: true) + visit project_settings_repository_path(project) + expect(page).to have_content('Branch rules') + end end context 'Deploy Keys', :js do @@ -164,13 +164,7 @@ RSpec.describe 'Projects > Settings > Repository settings' do end project.reload - - # TODO: The following line is skipped because a toast with - # "An error occurred while loading branch rules. Please try again." - # shows up right after which hides the below message. It is causing flakiness. - # https://gitlab.com/gitlab-org/gitlab/-/issues/383717#note_1185091998 - - # expect(page).to have_content('Mirroring settings were successfully updated') + expect(page).to have_content('Mirroring settings were successfully updated') expect(project.remote_mirrors.first.only_protected_branches).to eq(false) end @@ -190,13 +184,7 @@ RSpec.describe 'Projects > Settings > Repository settings' do end project.reload - - # TODO: The following line is skipped because a toast with - # "An error occurred while loading branch rules. Please try again." - # shows up right after which hides the below message. It is causing flakiness. - # https://gitlab.com/gitlab-org/gitlab/-/issues/383717#note_1185091998 - - # expect(page).to have_content('Mirroring settings were successfully updated') + expect(page).to have_content('Mirroring settings were successfully updated') expect(project.remote_mirrors.first.only_protected_branches).to eq(true) end @@ -213,7 +201,12 @@ RSpec.describe 'Projects > Settings > Repository settings' do click_button 'Mirror repository' end - expect(page).to have_content('Mirroring settings were successfully updated') + # TODO: The following line is skipped because a toast with + # "An error occurred while loading branch rules. Please try again." + # shows up right after which hides the below message. It is causing flakiness. + # https://gitlab.com/gitlab-org/gitlab/-/issues/383717#note_1185091998 + + # expect(page).to have_content('Mirroring settings were successfully updated') expect(project.reload.remote_mirrors.first.keep_divergent_refs).to eq(true) end @@ -229,7 +222,12 @@ RSpec.describe 'Projects > Settings > Repository settings' do click_button 'Mirror repository' end - expect(page).to have_content('Mirroring settings were successfully updated') + # TODO: The following line is skipped because a toast with + # "An error occurred while loading branch rules. Please try again." + # shows up right after which hides the below message. It is causing flakiness. + # https://gitlab.com/gitlab-org/gitlab/-/issues/383717#note_1185091998 + + # expect(page).to have_content('Mirroring settings were successfully updated') expect(page).to have_selector('[title="Copy SSH public key"]') end @@ -272,7 +270,6 @@ RSpec.describe 'Projects > Settings > Repository settings' do click_button 'Start cleanup' end end - expect(page).to have_content('Repository cleanup has started') expect(RepositoryCleanupWorker.jobs.count).to eq(1) end diff --git a/spec/features/projects/settings/secure_files_spec.rb b/spec/features/projects/settings/secure_files_spec.rb index ee38acf1953..9afe1f4de54 100644 --- a/spec/features/projects/settings/secure_files_spec.rb +++ b/spec/features/projects/settings/secure_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Secure Files', :js do +RSpec.describe 'Secure Files', :js, feature_category: :projects do let(:project) { create(:project) } let(:user) { create(:user) } @@ -12,31 +12,10 @@ RSpec.describe 'Secure Files', :js do sign_in(user) end - context 'when the :ci_secure_files feature flag is enabled' do - before do - stub_feature_flags(ci_secure_files: true) - - visit project_settings_ci_cd_path(project) - end - - context 'authenticated user with admin permissions' do - it 'shows the secure files settings' do - expect(page).to have_content('Secure Files') - end - end - end - - context 'when the :ci_secure_files feature flag is disabled' do - before do - stub_feature_flags(ci_secure_files: false) - + context 'authenticated user with admin permissions' do + it 'shows the secure files settings' do visit project_settings_ci_cd_path(project) - end - - context 'authenticated user with admin permissions' do - it 'does not shows the secure files settings' do - expect(page).not_to have_content('Secure Files') - end + expect(page).to have_content('Secure Files') end end diff --git a/spec/features/projects/settings/service_desk_setting_spec.rb b/spec/features/projects/settings/service_desk_setting_spec.rb index 86c5c3d2d8c..859c738731b 100644 --- a/spec/features/projects/settings/service_desk_setting_spec.rb +++ b/spec/features/projects/settings/service_desk_setting_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Service Desk Setting', :js, :clean_gitlab_redis_cache do +RSpec.describe 'Service Desk Setting', :js, :clean_gitlab_redis_cache, feature_category: :projects do let(:project) { create(:project_empty_repo, :private, service_desk_enabled: false) } let(:presenter) { project.present(current_user: user) } let(:user) { create(:user) } diff --git a/spec/features/projects/settings/user_archives_project_spec.rb b/spec/features/projects/settings/user_archives_project_spec.rb index 03ea9e7c580..a6aac02d272 100644 --- a/spec/features/projects/settings/user_archives_project_spec.rb +++ b/spec/features/projects/settings/user_archives_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > User archives a project' do +RSpec.describe 'Projects > Settings > User archives a project', feature_category: :projects do let(:user) { create(:user) } before do diff --git a/spec/features/projects/settings/user_changes_avatar_spec.rb b/spec/features/projects/settings/user_changes_avatar_spec.rb index 92d5b4c1fcd..87043aec9b6 100644 --- a/spec/features/projects/settings/user_changes_avatar_spec.rb +++ b/spec/features/projects/settings/user_changes_avatar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > User changes avatar' do +RSpec.describe 'Projects > Settings > User changes avatar', feature_category: :projects do let(:project) { create(:project, :repository) } let(:user) { project.creator } diff --git a/spec/features/projects/settings/user_changes_default_branch_spec.rb b/spec/features/projects/settings/user_changes_default_branch_spec.rb index bf064839bd7..39704fdbbb2 100644 --- a/spec/features/projects/settings/user_changes_default_branch_spec.rb +++ b/spec/features/projects/settings/user_changes_default_branch_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > User changes default branch' do +RSpec.describe 'Projects > Settings > User changes default branch', feature_category: :projects do let(:user) { create(:user) } before do diff --git a/spec/features/projects/settings/user_interacts_with_deploy_keys_spec.rb b/spec/features/projects/settings/user_interacts_with_deploy_keys_spec.rb index 0fc12f93850..3a58de9aa7d 100644 --- a/spec/features/projects/settings/user_interacts_with_deploy_keys_spec.rb +++ b/spec/features/projects/settings/user_interacts_with_deploy_keys_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe "User interacts with deploy keys", :js do +RSpec.describe "User interacts with deploy keys", :js, feature_category: :projects do let(:project) { create(:project, :repository) } let(:user) { project.first_owner } diff --git a/spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb b/spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb index c76b4d0af88..cfefdd54c23 100644 --- a/spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb +++ b/spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -RSpec.describe 'Projects > Settings > User manages merge request settings' do +RSpec.describe 'Projects > Settings > User manages merge request settings', feature_category: :projects do include ProjectForksHelper let(:user) { create(:user) } diff --git a/spec/features/projects/settings/user_manages_project_members_spec.rb b/spec/features/projects/settings/user_manages_project_members_spec.rb index 1d258582b3a..ee832da48d9 100644 --- a/spec/features/projects/settings/user_manages_project_members_spec.rb +++ b/spec/features/projects/settings/user_manages_project_members_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > User manages project members' do +RSpec.describe 'Projects > Settings > User manages project members', feature_category: :projects do include Spec::Support::Helpers::Features::MembersHelpers include Spec::Support::Helpers::ModalHelpers @@ -51,8 +51,6 @@ RSpec.describe 'Projects > Settings > User manages project members' do click_button 'Import project members' wait_for_requests - page.refresh - expect(find_member_row(user_mike)).to have_content('Reporter') end diff --git a/spec/features/projects/settings/user_renames_a_project_spec.rb b/spec/features/projects/settings/user_renames_a_project_spec.rb index 2e2d7119e2e..2da6e760fbf 100644 --- a/spec/features/projects/settings/user_renames_a_project_spec.rb +++ b/spec/features/projects/settings/user_renames_a_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > User renames a project' do +RSpec.describe 'Projects > Settings > User renames a project', feature_category: :projects do let(:user) { create(:user) } let(:project) { create(:project, namespace: user.namespace, path: 'gitlab', name: 'sample') } diff --git a/spec/features/projects/settings/user_searches_in_settings_spec.rb b/spec/features/projects/settings/user_searches_in_settings_spec.rb index 7ed96d01189..8a11507d064 100644 --- a/spec/features/projects/settings/user_searches_in_settings_spec.rb +++ b/spec/features/projects/settings/user_searches_in_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User searches project settings', :js do +RSpec.describe 'User searches project settings', :js, feature_category: :projects do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, :repository, namespace: user.namespace, pages_https_only: false) } diff --git a/spec/features/projects/settings/user_sees_revoke_deploy_token_modal_spec.rb b/spec/features/projects/settings/user_sees_revoke_deploy_token_modal_spec.rb index 47383be1ba1..65aed4fd06f 100644 --- a/spec/features/projects/settings/user_sees_revoke_deploy_token_modal_spec.rb +++ b/spec/features/projects/settings/user_sees_revoke_deploy_token_modal_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Repository Settings > User sees revoke deploy token modal', :js do +RSpec.describe 'Repository Settings > User sees revoke deploy token modal', :js, feature_category: :projects do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:role) { :developer } diff --git a/spec/features/projects/settings/user_tags_project_spec.rb b/spec/features/projects/settings/user_tags_project_spec.rb index e9a2aa29352..43e8e5a2d38 100644 --- a/spec/features/projects/settings/user_tags_project_spec.rb +++ b/spec/features/projects/settings/user_tags_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > User tags a project', :js do +RSpec.describe 'Projects > Settings > User tags a project', :js, feature_category: :projects do let(:user) { create(:user) } let(:project) { create(:project, namespace: user.namespace) } let!(:topic) { create(:topic, name: 'topic1') } diff --git a/spec/features/projects/settings/user_transfers_a_project_spec.rb b/spec/features/projects/settings/user_transfers_a_project_spec.rb index 23e10a36cee..53b4ee881f9 100644 --- a/spec/features/projects/settings/user_transfers_a_project_spec.rb +++ b/spec/features/projects/settings/user_transfers_a_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > User transfers a project', :js do +RSpec.describe 'Projects > Settings > User transfers a project', :js, feature_category: :projects do let(:user) { create(:user) } let(:project) { create(:project, :repository, namespace: user.namespace) } let(:group) { create(:group) } diff --git a/spec/features/projects/settings/visibility_settings_spec.rb b/spec/features/projects/settings/visibility_settings_spec.rb index 5cb12544066..5246eda976b 100644 --- a/spec/features/projects/settings/visibility_settings_spec.rb +++ b/spec/features/projects/settings/visibility_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > Visibility settings', :js do +RSpec.describe 'Projects > Settings > Visibility settings', :js, feature_category: :projects do let(:user) { create(:user) } let(:project) { create(:project, namespace: user.namespace, visibility_level: 20) } @@ -28,26 +28,6 @@ RSpec.describe 'Projects > Settings > Visibility settings', :js do expect(visibility_select_container).to have_content 'Only accessible by project members. Membership must be explicitly granted to each user.' end - context 'builds select' do - it 'hides builds select section' do - find('.project-feature-controls[data-for="project[project_feature_attributes][builds_access_level]"] .gl-toggle').click - - visit project_settings_merge_requests_path(project) - - expect(page).to have_selector('.builds-feature', visible: false) - end - - context 'given project with builds_disabled access level' do - let(:project) { create(:project, :builds_disabled, namespace: user.namespace) } - - it 'hides builds select section' do - visit project_settings_merge_requests_path(project) - - expect(page).to have_selector('.builds-feature', visible: false) - end - end - end - context 'disable email notifications' do it 'is visible' do expect(page).to have_selector('.js-emails-disabled', visible: true) diff --git a/spec/features/projects/settings/webhooks_settings_spec.rb b/spec/features/projects/settings/webhooks_settings_spec.rb index adbf2f6ee5c..8d22d84b9c9 100644 --- a/spec/features/projects/settings/webhooks_settings_spec.rb +++ b/spec/features/projects/settings/webhooks_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Settings > Webhook Settings' do +RSpec.describe 'Projects > Settings > Webhook Settings', feature_category: :projects do let(:project) { create(:project) } let(:user) { create(:user) } let(:webhooks_path) { project_hooks_path(project) } @@ -41,54 +41,28 @@ RSpec.describe 'Projects > Settings > Webhook Settings' do expect(page).to have_content('Tag push events') expect(page).to have_content('Issues events') expect(page).to have_content('Confidential issues events') - expect(page).to have_content('Note events') - expect(page).to have_content('Merge requests events') + expect(page).to have_content('Comment') + expect(page).to have_content('Merge request events') expect(page).to have_content('Pipeline events') expect(page).to have_content('Wiki page events') expect(page).to have_content('Releases events') end - context 'when feature flag "enhanced_webhook_support_regex" is disabled' do - before do - stub_feature_flags(enhanced_webhook_support_regex: false) - end - - it 'create webhook', :js do - visit webhooks_path - - fill_in 'URL', with: url - check 'Tag push events' - fill_in 'hook_push_events_branch_filter', with: 'master' - check 'Enable SSL verification' - check 'Job events' - - click_button 'Add webhook' - - expect(page).to have_content(url) - expect(page).to have_content('SSL Verification: enabled') - expect(page).to have_content('Tag push events') - expect(page).to have_content('Job events') - expect(page).to have_content('Push events') - end - end - - context 'when feature flag "enhanced_webhook_support_regex" is enabled' do - it 'create webhook', :js do - visit webhooks_path + it 'create webhook', :js do + visit webhooks_path - fill_in 'URL', with: url - check 'Tag push events' - check 'Enable SSL verification' - check 'Job events' + fill_in 'URL', with: url + check 'Tag push events' + check 'Enable SSL verification' + check 'Job events' - click_button 'Add webhook' + click_button 'Add webhook' - expect(page).to have_content(url) - expect(page).to have_content('SSL Verification: enabled') - expect(page).to have_content('Tag push events') - expect(page).to have_content('Job events') - expect(page).to have_content('Push events') - end + expect(page).to have_content(url) + expect(page).to have_content('SSL Verification: enabled') + expect(page).to have_content('Tag push events') + expect(page).to have_content('Job events') + expect(page).to have_content('Push events') end it 'edit existing webhook', :js do @@ -100,8 +74,8 @@ RSpec.describe 'Projects > Settings > Webhook Settings' do check 'Enable SSL verification' click_button 'Save changes' - expect(page).to have_content 'SSL Verification: enabled' - expect(page).to have_content(url) + expect(page).to have_content('Enable SSL verification') + expect(page).to have_current_path(edit_project_hook_path(project, hook), ignore_query: true) end it 'test existing webhook', :js do diff --git a/spec/features/projects/show/download_buttons_spec.rb b/spec/features/projects/show/download_buttons_spec.rb index e73bb3198e6..e4d50daa6f4 100644 --- a/spec/features/projects/show/download_buttons_spec.rb +++ b/spec/features/projects/show/download_buttons_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Show > Download buttons' do +RSpec.describe 'Projects > Show > Download buttons', feature_category: :projects do let(:user) { create(:user) } let(:role) { :developer } let(:status) { 'success' } diff --git a/spec/features/projects/show/no_password_spec.rb b/spec/features/projects/show/no_password_spec.rb index ed06f4e14d3..9ead729af83 100644 --- a/spec/features/projects/show/no_password_spec.rb +++ b/spec/features/projects/show/no_password_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'No Password Alert' do +RSpec.describe 'No Password Alert', feature_category: :projects do let_it_be(:message_password_auth_enabled) { 'Your account is authenticated with SSO or SAML. To push and pull over HTTP with Git using this account, you must set a password or set up a Personal Access Token to use instead of a password. For more information, see Clone with HTTPS.' } let_it_be(:message_password_auth_disabled) { 'Your account is authenticated with SSO or SAML. To push and pull over HTTP with Git using this account, you must set up a Personal Access Token to use instead of a password. For more information, see Clone with HTTPS.' } diff --git a/spec/features/projects/show/redirects_spec.rb b/spec/features/projects/show/redirects_spec.rb index 55069cdd6c5..d1cb896450f 100644 --- a/spec/features/projects/show/redirects_spec.rb +++ b/spec/features/projects/show/redirects_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Show > Redirects' do +RSpec.describe 'Projects > Show > Redirects', feature_category: :projects do let(:user) { create :user } let(:public_project) { create :project, :public } let(:private_project) { create :project, :private } diff --git a/spec/features/projects/show/rss_spec.rb b/spec/features/projects/show/rss_spec.rb index 0bd6e9cbe3b..c2e8a844094 100644 --- a/spec/features/projects/show/rss_spec.rb +++ b/spec/features/projects/show/rss_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Show > RSS' do +RSpec.describe 'Projects > Show > RSS', feature_category: :projects do let(:user) { create(:user) } let(:project) { create(:project, :repository, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } let(:path) { project_path(project) } diff --git a/spec/features/projects/show/schema_markup_spec.rb b/spec/features/projects/show/schema_markup_spec.rb index 8adbdb64f1b..8262245c5cb 100644 --- a/spec/features/projects/show/schema_markup_spec.rb +++ b/spec/features/projects/show/schema_markup_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Show > Schema Markup' do +RSpec.describe 'Projects > Show > Schema Markup', feature_category: :projects do let_it_be(:project) { create(:project, :repository, :public, :with_avatar, description: 'foobar', topic_list: 'topic1, topic2') } it 'shows SoftwareSourceCode structured markup', :js do diff --git a/spec/features/projects/show/user_interacts_with_auto_devops_banner_spec.rb b/spec/features/projects/show/user_interacts_with_auto_devops_banner_spec.rb index 262885e09b3..2f33622d218 100644 --- a/spec/features/projects/show/user_interacts_with_auto_devops_banner_spec.rb +++ b/spec/features/projects/show/user_interacts_with_auto_devops_banner_spec.rb @@ -2,7 +2,8 @@ require 'spec_helper' -RSpec.describe 'Project > Show > User interacts with auto devops implicitly enabled banner' do +RSpec.describe 'Project > Show > User interacts with auto devops implicitly enabled banner', +feature_category: :projects do let(:project) { create(:project, :repository) } let(:user) { create(:user) } diff --git a/spec/features/projects/show/user_interacts_with_stars_spec.rb b/spec/features/projects/show/user_interacts_with_stars_spec.rb index 158b6aa9b46..e2166854ba3 100644 --- a/spec/features/projects/show/user_interacts_with_stars_spec.rb +++ b/spec/features/projects/show/user_interacts_with_stars_spec.rb @@ -2,13 +2,14 @@ require 'spec_helper' -RSpec.describe 'Projects > Show > User interacts with project stars' do +RSpec.describe 'Projects > Show > User interacts with project stars', feature_category: :projects do let(:project) { create(:project, :public, :repository) } context 'when user is signed in', :js do let(:user) { create(:user) } before do + stub_feature_flags(vscode_web_ide: false) sign_in(user) visit(project_path(project)) end diff --git a/spec/features/projects/show/user_manages_notifications_spec.rb b/spec/features/projects/show/user_manages_notifications_spec.rb index 1df37eef6a9..8f6535fd4f0 100644 --- a/spec/features/projects/show/user_manages_notifications_spec.rb +++ b/spec/features/projects/show/user_manages_notifications_spec.rb @@ -2,10 +2,11 @@ require 'spec_helper' -RSpec.describe 'Projects > Show > User manages notifications', :js do +RSpec.describe 'Projects > Show > User manages notifications', :js, feature_category: :projects do let(:project) { create(:project, :public, :repository) } before do + stub_feature_flags(vscode_web_ide: false) sign_in(project.first_owner) end @@ -23,7 +24,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do click_notifications_button page.within first('[data-testid="notification-dropdown"]') do - expect(page.find('.gl-new-dropdown-item.is-active')).to have_content('On mention') + expect(page.find('.gl-dropdown-item.is-active')).to have_content('On mention') expect(page).to have_css('[data-testid="notifications-icon"]') end end diff --git a/spec/features/projects/show/user_sees_collaboration_links_spec.rb b/spec/features/projects/show/user_sees_collaboration_links_spec.rb index c63427e56e6..145500a4c63 100644 --- a/spec/features/projects/show/user_sees_collaboration_links_spec.rb +++ b/spec/features/projects/show/user_sees_collaboration_links_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Show > Collaboration links', :js do +RSpec.describe 'Projects > Show > Collaboration links', :js, feature_category: :projects do using RSpec::Parameterized::TableSyntax let_it_be(:project) { create(:project, :repository, :public) } diff --git a/spec/features/projects/show/user_sees_deletion_failure_message_spec.rb b/spec/features/projects/show/user_sees_deletion_failure_message_spec.rb index 47e010dcf89..876eecfe559 100644 --- a/spec/features/projects/show/user_sees_deletion_failure_message_spec.rb +++ b/spec/features/projects/show/user_sees_deletion_failure_message_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Show > User sees a deletion failure message' do +RSpec.describe 'Projects > Show > User sees a deletion failure message', feature_category: :projects do let(:project) { create(:project, :empty_repo, pending_delete: true) } before do diff --git a/spec/features/projects/show/user_sees_git_instructions_spec.rb b/spec/features/projects/show/user_sees_git_instructions_spec.rb index 608bb4c5997..022f21f198d 100644 --- a/spec/features/projects/show/user_sees_git_instructions_spec.rb +++ b/spec/features/projects/show/user_sees_git_instructions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Show > User sees Git instructions' do +RSpec.describe 'Projects > Show > User sees Git instructions', feature_category: :projects do let_it_be(:user) { create(:user) } before do diff --git a/spec/features/projects/show/user_sees_last_commit_ci_status_spec.rb b/spec/features/projects/show/user_sees_last_commit_ci_status_spec.rb index 0aa0f7754c6..25d241f004e 100644 --- a/spec/features/projects/show/user_sees_last_commit_ci_status_spec.rb +++ b/spec/features/projects/show/user_sees_last_commit_ci_status_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Show > User sees last commit CI status' do +RSpec.describe 'Projects > Show > User sees last commit CI status', feature_category: :projects do let_it_be(:project) { create(:project, :repository, :public) } it 'shows the project README', :js do diff --git a/spec/features/projects/show/user_sees_readme_spec.rb b/spec/features/projects/show/user_sees_readme_spec.rb index 6a5b9472be8..a8c91b30f25 100644 --- a/spec/features/projects/show/user_sees_readme_spec.rb +++ b/spec/features/projects/show/user_sees_readme_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Show > User sees README' do +RSpec.describe 'Projects > Show > User sees README', feature_category: :projects do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, :repository, :public) } diff --git a/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb b/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb index 5056e245fed..9eb2d109829 100644 --- a/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb +++ b/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Show > User sees setup shortcut buttons' do +RSpec.describe 'Projects > Show > User sees setup shortcut buttons', feature_category: :projects do # For "New file", "Add license" functionality, # see spec/features/projects/files/project_owner_creates_license_file_spec.rb # see spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb diff --git a/spec/features/projects/show/user_uploads_files_spec.rb b/spec/features/projects/show/user_uploads_files_spec.rb index a222d6b42ab..ed378040ce9 100644 --- a/spec/features/projects/show/user_uploads_files_spec.rb +++ b/spec/features/projects/show/user_uploads_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Show > User uploads files' do +RSpec.describe 'Projects > Show > User uploads files', feature_category: :projects do include DropzoneHelper let(:user) { create(:user) } diff --git a/spec/features/projects/snippets/create_snippet_spec.rb b/spec/features/projects/snippets/create_snippet_spec.rb index cbdf6d6852e..f2c575231ad 100644 --- a/spec/features/projects/snippets/create_snippet_spec.rb +++ b/spec/features/projects/snippets/create_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Snippets > Create Snippet', :js do +RSpec.describe 'Projects > Snippets > Create Snippet', :js, feature_category: :snippets do include DropzoneHelper include Spec::Support::Helpers::Features::SnippetSpecHelpers diff --git a/spec/features/projects/snippets/show_spec.rb b/spec/features/projects/snippets/show_spec.rb index 5937ff75457..1a480696b4e 100644 --- a/spec/features/projects/snippets/show_spec.rb +++ b/spec/features/projects/snippets/show_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Snippets > Project snippet', :js do +RSpec.describe 'Projects > Snippets > Project snippet', :js, feature_category: :snippets do let_it_be(:user) { create(:user) } let_it_be(:project) do create(:project, creator: user).tap do |p| diff --git a/spec/features/projects/snippets/user_comments_on_snippet_spec.rb b/spec/features/projects/snippets/user_comments_on_snippet_spec.rb index 3ccb73c88ef..556f549f86c 100644 --- a/spec/features/projects/snippets/user_comments_on_snippet_spec.rb +++ b/spec/features/projects/snippets/user_comments_on_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Snippets > User comments on a snippet', :js do +RSpec.describe 'Projects > Snippets > User comments on a snippet', :js, feature_category: :snippets do let_it_be(:project) { create(:project) } let_it_be(:user) { create(:user) } let_it_be(:snippet) { create(:project_snippet, :repository, project: project, author: user) } diff --git a/spec/features/projects/snippets/user_deletes_snippet_spec.rb b/spec/features/projects/snippets/user_deletes_snippet_spec.rb index ca49e6a36b7..c9d1afb7a4e 100644 --- a/spec/features/projects/snippets/user_deletes_snippet_spec.rb +++ b/spec/features/projects/snippets/user_deletes_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Snippets > User deletes a snippet', :js do +RSpec.describe 'Projects > Snippets > User deletes a snippet', :js, feature_category: :snippets do let(:project) { create(:project) } let!(:snippet) { create(:project_snippet, :repository, project: project, author: user) } let(:user) { create(:user) } diff --git a/spec/features/projects/snippets/user_updates_snippet_spec.rb b/spec/features/projects/snippets/user_updates_snippet_spec.rb index aa498163f52..205db6c08b1 100644 --- a/spec/features/projects/snippets/user_updates_snippet_spec.rb +++ b/spec/features/projects/snippets/user_updates_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Snippets > User updates a snippet', :js do +RSpec.describe 'Projects > Snippets > User updates a snippet', :js, feature_category: :snippets do include Spec::Support::Helpers::Features::SnippetSpecHelpers let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/snippets/user_views_snippets_spec.rb b/spec/features/projects/snippets/user_views_snippets_spec.rb index 40539b43ed5..ece65763ea5 100644 --- a/spec/features/projects/snippets/user_views_snippets_spec.rb +++ b/spec/features/projects/snippets/user_views_snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Snippets > User views snippets' do +RSpec.describe 'Projects > Snippets > User views snippets', feature_category: :snippets do let_it_be(:project) { create(:project) } let(:user) { create(:user) } diff --git a/spec/features/projects/sourcegraph_csp_spec.rb b/spec/features/projects/sourcegraph_csp_spec.rb index 10dd050e8cc..4c8dd0a7df0 100644 --- a/spec/features/projects/sourcegraph_csp_spec.rb +++ b/spec/features/projects/sourcegraph_csp_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Sourcegraph Content Security Policy' do +RSpec.describe 'Sourcegraph Content Security Policy', feature_category: :projects do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, :repository, namespace: user.namespace) } diff --git a/spec/features/projects/sub_group_issuables_spec.rb b/spec/features/projects/sub_group_issuables_spec.rb index d7614201740..2502d969305 100644 --- a/spec/features/projects/sub_group_issuables_spec.rb +++ b/spec/features/projects/sub_group_issuables_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Subgroup Issuables', :js do +RSpec.describe 'Subgroup Issuables', :js, feature_category: :projects do let!(:group) { create(:group, name: 'group') } let!(:subgroup) { create(:group, parent: group, name: 'subgroup') } let!(:project) { create(:project, namespace: subgroup, name: 'project') } diff --git a/spec/features/projects/tags/download_buttons_spec.rb b/spec/features/projects/tags/download_buttons_spec.rb index 0f1f72fd039..570721fc951 100644 --- a/spec/features/projects/tags/download_buttons_spec.rb +++ b/spec/features/projects/tags/download_buttons_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Download buttons in tags page' do +RSpec.describe 'Download buttons in tags page', feature_category: :source_code_management do let(:user) { create(:user) } let(:role) { :developer } let(:status) { 'success' } diff --git a/spec/features/projects/tags/user_edits_tags_spec.rb b/spec/features/projects/tags/user_edits_tags_spec.rb index 857d0696659..e0efe3b465f 100644 --- a/spec/features/projects/tags/user_edits_tags_spec.rb +++ b/spec/features/projects/tags/user_edits_tags_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project > Tags', :js do +RSpec.describe 'Project > Tags', :js, feature_category: :source_code_management do include DropzoneHelper let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/tags/user_views_tag_spec.rb b/spec/features/projects/tags/user_views_tag_spec.rb index 3978c5b7b78..0816b3240c9 100644 --- a/spec/features/projects/tags/user_views_tag_spec.rb +++ b/spec/features/projects/tags/user_views_tag_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -RSpec.describe 'User views tag', :feature do +RSpec.describe 'User views tag', :feature, feature_category: :source_code_management do include_examples 'user views tag' do let(:tag_page) { project_tag_path(project, id: tag_name) } end diff --git a/spec/features/projects/tags/user_views_tags_spec.rb b/spec/features/projects/tags/user_views_tags_spec.rb index d3849df023e..26f2e81e3df 100644 --- a/spec/features/projects/tags/user_views_tags_spec.rb +++ b/spec/features/projects/tags/user_views_tags_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -RSpec.describe 'User views tags', :feature do +RSpec.describe 'User views tags', :feature, feature_category: :source_code_management do include_examples 'user views tag' do let(:tag_page) { project_tags_path(project) } end diff --git a/spec/features/projects/terraform_spec.rb b/spec/features/projects/terraform_spec.rb index d9e45b5e78e..bbc7f675c55 100644 --- a/spec/features/projects/terraform_spec.rb +++ b/spec/features/projects/terraform_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Terraform', :js do +RSpec.describe 'Terraform', :js, feature_category: :projects do let_it_be(:project) { create(:project) } let_it_be(:terraform_state) { create(:terraform_state, :locked, :with_version, project: project) } diff --git a/spec/features/projects/tree/create_directory_spec.rb b/spec/features/projects/tree/create_directory_spec.rb index 9c950cfee6e..3a0160c42fb 100644 --- a/spec/features/projects/tree/create_directory_spec.rb +++ b/spec/features/projects/tree/create_directory_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Multi-file editor new directory', :js do +RSpec.describe 'Multi-file editor new directory', :js, feature_category: :web_ide do let(:user) { create(:user) } let(:project) { create(:project, :repository) } diff --git a/spec/features/projects/tree/create_file_spec.rb b/spec/features/projects/tree/create_file_spec.rb index c0567ed4580..61240150658 100644 --- a/spec/features/projects/tree/create_file_spec.rb +++ b/spec/features/projects/tree/create_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Multi-file editor new file', :js do +RSpec.describe 'Multi-file editor new file', :js, feature_category: :web_ide do let(:user) { create(:user) } let(:project) { create(:project, :repository) } diff --git a/spec/features/projects/tree/rss_spec.rb b/spec/features/projects/tree/rss_spec.rb index efbfc329c9f..0b016ee3dd9 100644 --- a/spec/features/projects/tree/rss_spec.rb +++ b/spec/features/projects/tree/rss_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project Tree RSS' do +RSpec.describe 'Project Tree RSS', feature_category: :projects do let(:user) { create(:user) } let(:project) { create(:project, :repository, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } let(:path) { project_tree_path(project, :master) } diff --git a/spec/features/projects/tree/tree_show_spec.rb b/spec/features/projects/tree/tree_show_spec.rb index eb0ef756b30..21932cae58b 100644 --- a/spec/features/projects/tree/tree_show_spec.rb +++ b/spec/features/projects/tree/tree_show_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects tree', :js do +RSpec.describe 'Projects tree', :js, feature_category: :web_ide do include RepoHelpers let(:user) { create(:user) } @@ -157,17 +157,22 @@ RSpec.describe 'Projects tree', :js do end end - context 'ref switcher' do + context 'ref switcher', :js do it 'switches ref to branch' do + ref_selector = '.ref-selector' ref_name = 'feature' visit project_tree_path(project, 'master') - first('.js-project-refs-dropdown').click - page.within '.project-refs-form' do - click_link ref_name + find(ref_selector).click + wait_for_requests + + page.within(ref_selector) do + fill_in 'Search by Git revision', with: ref_name + wait_for_requests + find('li', text: ref_name, match: :prefer_exact).click end - expect(page).to have_selector '.dropdown-menu-toggle', text: ref_name + expect(find(ref_selector)).to have_text(ref_name) end end end diff --git a/spec/features/projects/tree/upload_file_spec.rb b/spec/features/projects/tree/upload_file_spec.rb index f32141d6051..1e4abc789c2 100644 --- a/spec/features/projects/tree/upload_file_spec.rb +++ b/spec/features/projects/tree/upload_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Multi-file editor upload file', :js do +RSpec.describe 'Multi-file editor upload file', :js, feature_category: :web_ide do let(:user) { create(:user) } let(:project) { create(:project, :repository) } let(:txt_file) { File.join(Rails.root, 'spec', 'fixtures', 'doc_sample.txt') } diff --git a/spec/features/projects/user_changes_project_visibility_spec.rb b/spec/features/projects/user_changes_project_visibility_spec.rb index df13bb55c6d..5daa5b98b6e 100644 --- a/spec/features/projects/user_changes_project_visibility_spec.rb +++ b/spec/features/projects/user_changes_project_visibility_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User changes public project visibility', :js do +RSpec.describe 'User changes public project visibility', :js, feature_category: :projects do include ProjectForksHelper shared_examples 'changing visibility to private' do diff --git a/spec/features/projects/user_creates_project_spec.rb b/spec/features/projects/user_creates_project_spec.rb index b07f2d12660..af0bd932095 100644 --- a/spec/features/projects/user_creates_project_spec.rb +++ b/spec/features/projects/user_creates_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User creates a project', :js do +RSpec.describe 'User creates a project', :js, feature_category: :projects do let(:user) { create(:user) } before do diff --git a/spec/features/projects/user_sees_sidebar_spec.rb b/spec/features/projects/user_sees_sidebar_spec.rb index e2498928fa0..3a6e11356a2 100644 --- a/spec/features/projects/user_sees_sidebar_spec.rb +++ b/spec/features/projects/user_sees_sidebar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > User sees sidebar' do +RSpec.describe 'Projects > User sees sidebar', feature_category: :projects do let(:user) { create(:user) } let(:project) { create(:project, :private, public_builds: false, namespace: user.namespace) } @@ -220,7 +220,7 @@ RSpec.describe 'Projects > User sees sidebar' do it 'does not show fork button' do visit project_path(project) - within('.count-buttons') do + within('.project-repo-buttons') do expect(page).not_to have_link 'Fork' end end diff --git a/spec/features/projects/user_sees_user_popover_spec.rb b/spec/features/projects/user_sees_user_popover_spec.rb index 0bbe7f26cd4..5badcd99dff 100644 --- a/spec/features/projects/user_sees_user_popover_spec.rb +++ b/spec/features/projects/user_sees_user_popover_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User sees user popover', :js do +RSpec.describe 'User sees user popover', :js, feature_category: :projects do include Spec::Support::Helpers::Features::NotesHelpers let_it_be(:user) { create(:user, pronouns: 'they/them') } diff --git a/spec/features/projects/user_sorts_projects_spec.rb b/spec/features/projects/user_sorts_projects_spec.rb index c40f01f3aa1..6a18d95c840 100644 --- a/spec/features/projects/user_sorts_projects_spec.rb +++ b/spec/features/projects/user_sorts_projects_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User sorts projects and order persists' do +RSpec.describe 'User sorts projects and order persists', feature_category: :projects do include CookieHelper let_it_be(:user) { create(:user) } @@ -73,7 +73,7 @@ RSpec.describe 'User sorts projects and order persists' do end end - it_behaves_like "sort order persists across all views", "Created date", "Created" + it_behaves_like "sort order persists across all views", "Oldest created", "Created" end context 'from group details', :js do @@ -82,11 +82,11 @@ RSpec.describe 'User sorts projects and order persists' do visit(details_group_path(group)) within '[data-testid=group_sort_by_dropdown]' do find('button.gl-dropdown-toggle').click - first(:button, 'Stars').click + first(:button, 'Updated').click wait_for_requests end end - it_behaves_like "sort order persists across all views", "Stars", "Stars" + it_behaves_like "sort order persists across all views", "Oldest updated", "Updated" end end diff --git a/spec/features/projects/user_uses_shortcuts_spec.rb b/spec/features/projects/user_uses_shortcuts_spec.rb index cd6f09ce275..05d79ea3b1b 100644 --- a/spec/features/projects/user_uses_shortcuts_spec.rb +++ b/spec/features/projects/user_uses_shortcuts_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User uses shortcuts', :js do +RSpec.describe 'User uses shortcuts', :js, feature_category: :projects do let_it_be(:project) { create(:project, :repository) } let(:user) { project.first_owner } diff --git a/spec/features/projects/user_views_empty_project_spec.rb b/spec/features/projects/user_views_empty_project_spec.rb index 696a7f4ee8a..352fa73bd05 100644 --- a/spec/features/projects/user_views_empty_project_spec.rb +++ b/spec/features/projects/user_views_empty_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User views an empty project' do +RSpec.describe 'User views an empty project', feature_category: :projects do let_it_be(:project) { create(:project, :empty_repo) } let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/view_on_env_spec.rb b/spec/features/projects/view_on_env_spec.rb index 5dd30f59e3d..bf32431fc88 100644 --- a/spec/features/projects/view_on_env_spec.rb +++ b/spec/features/projects/view_on_env_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'View on environment', :js do +RSpec.describe 'View on environment', :js, feature_category: :projects do let(:branch_name) { 'feature' } let(:file_path) { 'files/ruby/feature.rb' } let(:project) { create(:project, :repository) } diff --git a/spec/features/projects/wiki/user_views_wiki_empty_spec.rb b/spec/features/projects/wiki/user_views_wiki_empty_spec.rb index ea045ddb6a1..1f3ba7a5ca2 100644 --- a/spec/features/projects/wiki/user_views_wiki_empty_spec.rb +++ b/spec/features/projects/wiki/user_views_wiki_empty_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project > User views empty wiki' do +RSpec.describe 'Project > User views empty wiki', feature_category: :wiki do let_it_be(:user) { create(:user) } let(:wiki) { create(:project_wiki, project: project) } diff --git a/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb b/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb index db2b3fc2f4b..79744633d0c 100644 --- a/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb +++ b/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Wiki > User views wiki in project page' do +RSpec.describe 'Projects > Wiki > User views wiki in project page', feature_category: :wiki do before do sign_in(project.first_owner) end diff --git a/spec/features/projects/wikis_spec.rb b/spec/features/projects/wikis_spec.rb index 879ffd2932b..5d950da6674 100644 --- a/spec/features/projects/wikis_spec.rb +++ b/spec/features/projects/wikis_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe 'Project wikis', :js do +RSpec.describe 'Project wikis', :js, feature_category: :wiki do let_it_be(:user) { create(:user) } let(:wiki) { create(:project_wiki, user: user, project: project) } |