diff options
Diffstat (limited to 'spec/features/groups')
25 files changed, 240 insertions, 74 deletions
diff --git a/spec/features/groups/board_spec.rb b/spec/features/groups/board_spec.rb index c451a97bed5..8acf3ffe441 100644 --- a/spec/features/groups/board_spec.rb +++ b/spec/features/groups/board_spec.rb @@ -25,8 +25,10 @@ RSpec.describe 'Group Boards', feature_category: :team_planning do it 'adds an issue to the backlog' do page.within(find('.board', match: :first)) do - issue_title = 'New Issue' - click_button 'New issue' + dropdown = first("[data-testid='header-list-actions']") + dropdown.click + issue_title = 'Create new issue' + click_button issue_title wait_for_requests diff --git a/spec/features/groups/container_registry_spec.rb b/spec/features/groups/container_registry_spec.rb index 11f94967aaf..ab8d8238bdc 100644 --- a/spec/features/groups/container_registry_spec.rb +++ b/spec/features/groups/container_registry_spec.rb @@ -95,7 +95,11 @@ RSpec.describe 'Container Registry', :js, feature_category: :container_registry first('[data-testid="additional-actions"]').click first('[data-testid="single-delete-button"]').click expect(find('.modal .modal-title')).to have_content _('Remove tag') + stub_container_registry_tags(repository: %r{my/image}, tags: [], with_manifest: true) find('.modal .modal-footer .btn-danger').click + + expect(page).to have_content '0 tags' + expect(page).not_to have_content '1 tag' end end end diff --git a/spec/features/groups/crm/contacts/create_spec.rb b/spec/features/groups/crm/contacts/create_spec.rb index 860cadd322d..aa05ef82a8b 100644 --- a/spec/features/groups/crm/contacts/create_spec.rb +++ b/spec/features/groups/crm/contacts/create_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' RSpec.describe 'Create a CRM contact', :js, feature_category: :service_desk do let(:user) { create(:user) } let(:group) { create(:group, :crm_enabled) } - let!(:organization) { create(:organization, group: group, name: 'GitLab') } + let!(:crm_organization) { create(:crm_organization, group: group, name: 'GitLab') } before do group.add_owner(user) diff --git a/spec/features/groups/dependency_proxy_spec.rb b/spec/features/groups/dependency_proxy_spec.rb index 05984d40ea6..60922f813df 100644 --- a/spec/features/groups/dependency_proxy_spec.rb +++ b/spec/features/groups/dependency_proxy_spec.rb @@ -52,6 +52,12 @@ RSpec.describe 'Group Dependency Proxy', feature_category: :dependency_proxy do expect(find('input[data-testid="proxy-url"]').value).to have_content('/dependency_proxy/containers') end + it 'has link to settings' do + visit path + + expect(page).to have_link s_('DependencyProxy|Configure in settings') + end + it 'hides the proxy URL when feature is disabled' do visit settings_path wait_for_requests @@ -80,6 +86,10 @@ RSpec.describe 'Group Dependency Proxy', feature_category: :dependency_proxy do it 'does not show the feature toggle but shows the proxy URL' do expect(find('input[data-testid="proxy-url"]').value).to have_content('/dependency_proxy/containers') end + + it 'does not have link to settings' do + expect(page).not_to have_link s_('DependencyProxy|Configure in settings') + end end end diff --git a/spec/features/groups/group_runners_spec.rb b/spec/features/groups/group_runners_spec.rb index ae757e04716..514110d78ae 100644 --- a/spec/features/groups/group_runners_spec.rb +++ b/spec/features/groups/group_runners_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe "Group Runners", feature_category: :runner_fleet do - include Spec::Support::Helpers::Features::RunnersHelpers + include Features::RunnersHelpers include Spec::Support::Helpers::ModalHelpers let_it_be(:group_owner) { create(:user) } @@ -16,10 +16,12 @@ RSpec.describe "Group Runners", feature_category: :runner_fleet do end describe "Group runners page", :js do - let!(:group_registration_token) { group.runners_token } + describe "legacy runners registration" do + let_it_be(:group_registration_token) { group.runners_token } - describe "runners registration" do before do + stub_feature_flags(create_runner_workflow_for_namespace: false) + visit group_runners_path(group) end @@ -60,15 +62,11 @@ RSpec.describe "Group Runners", feature_category: :runner_fleet do let(:runner) { group_runner } end - it 'shows a group badge' do - within_runner_row(group_runner.id) do - expect(page).to have_selector '.badge', text: s_('Runners|Group') - end - end - - it 'can edit runner information' do + it 'shows an editable group badge' do within_runner_row(group_runner.id) do expect(find_link('Edit')[:href]).to end_with(edit_group_runner_path(group, group_runner)) + + expect(page).to have_selector '.badge', text: s_('Runners|Group') end end @@ -102,15 +100,11 @@ RSpec.describe "Group Runners", feature_category: :runner_fleet do let(:runner) { project_runner } end - it 'shows a project badge' do - within_runner_row(project_runner.id) do - expect(page).to have_selector '.badge', text: s_('Runners|Project') - end - end - - it 'can edit runner information' do + it 'shows an editable project runner' do within_runner_row(project_runner.id) do expect(find_link('Edit')[:href]).to end_with(edit_group_runner_path(group, project_runner)) + + expect(page).to have_selector '.badge', text: s_('Runners|Project') end end end @@ -202,6 +196,16 @@ RSpec.describe "Group Runners", feature_category: :runner_fleet do end end + describe "Group runner create page", :js do + before do + visit new_group_runner_path(group) + end + + it_behaves_like 'creates runner and shows register page' do + let(:register_path_pattern) { register_group_runner_path(group, '.*') } + end + end + describe "Group runner show page", :js do let_it_be(:group_runner) do create(:ci_runner, :group, groups: [group], description: 'runner-foo') diff --git a/spec/features/groups/group_settings_spec.rb b/spec/features/groups/group_settings_spec.rb index 5510e73ef0f..6443f4a6c38 100644 --- a/spec/features/groups/group_settings_spec.rb +++ b/spec/features/groups/group_settings_spec.rb @@ -3,6 +3,8 @@ require 'spec_helper' RSpec.describe 'Edit group settings', feature_category: :subgroups do + include Spec::Support::Helpers::ModalHelpers + let(:user) { create(:user) } let(:group) { create(:group, path: 'foo') } @@ -72,7 +74,7 @@ RSpec.describe 'Edit group settings', feature_category: :subgroups do visit new_project_full_path expect(page).to have_current_path(new_project_full_path, ignore_query: true) - expect(find('.breadcrumbs')).to have_content(project.path) + expect(find('.breadcrumbs')).to have_content(project.name) end it 'the old project path redirects to the new path' do @@ -80,7 +82,7 @@ RSpec.describe 'Edit group settings', feature_category: :subgroups do visit old_project_full_path expect(page).to have_current_path(new_project_full_path, ignore_query: true) - expect(find('.breadcrumbs')).to have_content(project.path) + expect(find('.breadcrumbs')).to have_content(project.name) end end end @@ -147,14 +149,16 @@ RSpec.describe 'Edit group settings', feature_category: :subgroups do selected_group.add_owner(user) end - it 'can successfully transfer the group', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/384966' do + it 'can successfully transfer the group' do + selected_group_path = selected_group.path + visit edit_group_path(selected_group) page.within('[data-testid="transfer-locations-dropdown"]') do click_button _('Select parent group') - fill_in _('Search'), with: target_group_name + fill_in _('Search'), with: target_group&.name || '' wait_for_requests - click_button target_group_name + click_button(target_group&.name || 'No parent group') end click_button s_('GroupSettings|Transfer group') @@ -166,8 +170,16 @@ RSpec.describe 'Edit group settings', feature_category: :subgroups do click_button 'Confirm' end - expect(page).to have_text "Group '#{selected_group.name}' was successfully transferred." - expect(current_url).to include(selected_group.reload.full_path) + within('[data-testid="breadcrumb-links"]') do + expect(page).to have_content(target_group.name) if target_group + expect(page).to have_content(selected_group.name) + end + + if target_group + expect(current_url).to include("#{target_group.path}/#{selected_group_path}") + else + expect(current_url).to include(selected_group_path) + end end end @@ -175,14 +187,13 @@ RSpec.describe 'Edit group settings', feature_category: :subgroups do let(:selected_group) { create(:group, path: 'foo-subgroup', parent: group) } context 'when transfering to no parent group' do - let(:target_group_name) { 'No parent group' } + let(:target_group) { nil } it_behaves_like 'can transfer the group' end context 'when transfering to a parent group' do let(:target_group) { create(:group, path: 'foo-parentgroup') } - let(:target_group_name) { target_group.name } before do target_group.add_owner(user) @@ -194,7 +205,7 @@ RSpec.describe 'Edit group settings', feature_category: :subgroups do context 'when transfering from a root group to a parent group' do let(:selected_group) { create(:group, path: 'foo-rootgroup') } - let(:target_group_name) { group.name } + let(:target_group) { group } it_behaves_like 'can transfer the group' end @@ -235,6 +246,67 @@ RSpec.describe 'Edit group settings', feature_category: :subgroups do end end + describe 'group README', :js do + let_it_be(:group) { create(:group) } + + context 'with gitlab-profile project and README.md' do + let_it_be(:project) { create(:project, :readme, namespace: group) } + + it 'renders link to Group README and navigates to it on click' do + visit edit_group_path(group) + wait_for_requests + + click_link('README') + wait_for_requests + + expect(page).to have_current_path(project_blob_path(project, "#{project.default_branch}/README.md")) + expect(page).to have_text('README.md') + end + end + + context 'with gitlab-profile project and no README.md' do + let_it_be(:project) { create(:project, path: 'gitlab-profile', namespace: group) } + + it 'renders Add README button and allows user to create a README via the IDE' do + visit edit_group_path(group) + wait_for_requests + + expect(page).not_to have_selector('.ide') + + click_button('Add README') + + accept_gl_confirm("This will create a README.md for project #{group.readme_project.present.path_with_namespace}.", button_text: 'Add README') + wait_for_requests + + expect(page).to have_current_path("/-/ide/project/#{group.readme_project.present.path_with_namespace}/edit/main/-/README.md/") + + page.within('.ide') do + expect(page).to have_text('README.md') + end + end + end + + context 'with no gitlab-profile project and no README.md' do + it 'renders Add README button and allows user to create both the gitlab-profile project and README via the IDE' do + visit edit_group_path(group) + wait_for_requests + + expect(page).not_to have_selector('.ide') + + click_button('Add README') + + accept_gl_confirm("This will create a project #{group.full_path}/gitlab-profile and add a README.md.", button_text: 'Create and add README') + wait_for_requests + + expect(page).to have_current_path("/-/ide/project/#{group.full_path}/gitlab-profile/edit/main/-/README.md/") + + page.within('.ide') do + expect(page).to have_text('README.md') + end + end + end + end + def update_path(new_group_path) visit edit_group_path(group) diff --git a/spec/features/groups/import_export/connect_instance_spec.rb b/spec/features/groups/import_export/connect_instance_spec.rb index 8aea18a268b..f6548c035f0 100644 --- a/spec/features/groups/import_export/connect_instance_spec.rb +++ b/spec/features/groups/import_export/connect_instance_spec.rb @@ -26,7 +26,7 @@ RSpec.describe 'Import/Export - Connect to another instance', :js, feature_categ pat = 'demo-pat' expect(page).to have_content 'Import groups by direct transfer' - expect(page).to have_content 'Not all related objects are migrated' + expect(page).to have_content 'Not all group items are migrated' fill_in :bulk_import_gitlab_url, with: source_url fill_in :bulk_import_gitlab_access_token, with: pat diff --git a/spec/features/groups/integrations/group_integrations_spec.rb b/spec/features/groups/integrations/group_integrations_spec.rb index 0d65fa5964b..8cddda91e89 100644 --- a/spec/features/groups/integrations/group_integrations_spec.rb +++ b/spec/features/groups/integrations/group_integrations_spec.rb @@ -5,6 +5,10 @@ require 'spec_helper' RSpec.describe 'Group integrations', :js do include_context 'group integration activation' + before do + stub_feature_flags(remove_monitor_metrics: false) + end + it_behaves_like 'integration settings form' do let(:integrations) { Integration.find_or_initialize_all_non_project_specific(Integration.for_group(group)) } @@ -12,4 +16,16 @@ RSpec.describe 'Group integrations', :js do visit_group_integration(integration.title) end end + + context 'with remove_monitor_metrics flag enabled' do + before do + stub_feature_flags(remove_monitor_metrics: true) + end + + it 'returns a 404 for the prometheus edit page' do + visit edit_group_settings_integration_path(group, :prometheus) + + expect(page).to have_content "Page Not Found" + end + end end diff --git a/spec/features/groups/issues_spec.rb b/spec/features/groups/issues_spec.rb index 00c0d4c3ebe..6d0d768d356 100644 --- a/spec/features/groups/issues_spec.rb +++ b/spec/features/groups/issues_spec.rb @@ -23,6 +23,10 @@ RSpec.describe 'Group issues page', feature_category: :subgroups do context 'rss feed' do let(:access_level) { ProjectFeature::ENABLED } + before do + click_button 'Actions' + end + context 'when signed in' do let(:user) do user_in_group.ensure_feed_token @@ -30,29 +34,15 @@ RSpec.describe 'Group issues page', feature_category: :subgroups do user_in_group end + it_behaves_like "it has an RSS link with current_user's feed token" it_behaves_like "an autodiscoverable RSS feed with current_user's feed token" - - # Note: The one from rss_shared_example.rb uses a css pseudo-class `:has` - # which is VERY experimental and only supported in Nokogiri used by Capybara - # However,`:js` option forces Capybara to use Selenium that doesn't support`:has` - context "it has an RSS button with current_user's feed token" do - it "shows the RSS button with current_user's feed token" do - expect(page).to have_link 'Subscribe to RSS feed', href: /feed_token=#{user.feed_token}/ - end - end end context 'when signed out' do let(:user) { nil } + it_behaves_like "it has an RSS link without a feed token" it_behaves_like "an autodiscoverable RSS feed without a feed token" - - # Note: please see the above - context "it has an RSS button without a feed token" do - it "shows the RSS button without a feed token" do - expect(page).not_to have_link 'Subscribe to RSS feed', href: /feed_token/ - end - end end end diff --git a/spec/features/groups/labels/index_spec.rb b/spec/features/groups/labels/index_spec.rb index ea27fa2c5d9..7b0a38a83db 100644 --- a/spec/features/groups/labels/index_spec.rb +++ b/spec/features/groups/labels/index_spec.rb @@ -24,6 +24,7 @@ RSpec.describe 'Group labels', feature_category: :team_planning do end it 'shows an edit label button', :js do - expect(page).to have_selector('.edit') + click_button 'Label actions dropdown' + expect(page).to have_link('Edit') end end diff --git a/spec/features/groups/members/filter_members_spec.rb b/spec/features/groups/members/filter_members_spec.rb index dc33bb11bea..c2ec709576b 100644 --- a/spec/features/groups/members/filter_members_spec.rb +++ b/spec/features/groups/members/filter_members_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe 'Groups > Members > Filter members', :js, feature_category: :subgroups do - include Spec::Support::Helpers::Features::MembersHelpers + include Features::MembersHelpers let(:user) { create(:user) } let(:nested_group_user) { create(:user) } diff --git a/spec/features/groups/members/leave_group_spec.rb b/spec/features/groups/members/leave_group_spec.rb index cfb1b24bccb..e1c2d8c0547 100644 --- a/spec/features/groups/members/leave_group_spec.rb +++ b/spec/features/groups/members/leave_group_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe 'Groups > Members > Leave group', feature_category: :subgroups do - include Spec::Support::Helpers::Features::MembersHelpers + include Features::MembersHelpers include Spec::Support::Helpers::ModalHelpers let(:user) { create(:user) } diff --git a/spec/features/groups/members/list_members_spec.rb b/spec/features/groups/members/list_members_spec.rb index 1aea5a76b41..6e20f92c16b 100644 --- a/spec/features/groups/members/list_members_spec.rb +++ b/spec/features/groups/members/list_members_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe 'Groups > Members > List members', :js, feature_category: :subgroups do - include Spec::Support::Helpers::Features::MembersHelpers + include Features::MembersHelpers let(:user1) { create(:user, name: 'John Doe') } let(:user2) { create(:user, name: 'Mary Jane') } diff --git a/spec/features/groups/members/manage_groups_spec.rb b/spec/features/groups/members/manage_groups_spec.rb index ee8786a2e36..f9c11dd0183 100644 --- a/spec/features/groups/members/manage_groups_spec.rb +++ b/spec/features/groups/members/manage_groups_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' RSpec.describe 'Groups > Members > Manage groups', :js, feature_category: :subgroups do - include Spec::Support::Helpers::Features::MembersHelpers - include Spec::Support::Helpers::Features::InviteMembersModalHelper + include Features::MembersHelpers + include Features::InviteMembersModalHelpers include Spec::Support::Helpers::ModalHelpers let_it_be(:user) { create(:user) } diff --git a/spec/features/groups/members/manage_members_spec.rb b/spec/features/groups/members/manage_members_spec.rb index 5cd5908b359..2d5a3dbb8f8 100644 --- a/spec/features/groups/members/manage_members_spec.rb +++ b/spec/features/groups/members/manage_members_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' RSpec.describe 'Groups > Members > Manage members', feature_category: :subgroups do - include Spec::Support::Helpers::Features::MembersHelpers - include Spec::Support::Helpers::Features::InviteMembersModalHelper + include Features::MembersHelpers + include Features::InviteMembersModalHelpers include Spec::Support::Helpers::ModalHelpers let_it_be(:user1) { create(:user, name: 'John Doe') } diff --git a/spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb b/spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb index e9f80b05fa7..4f56c807ec8 100644 --- a/spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb +++ b/spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' RSpec.describe 'Groups > Members > Owner adds member with expiration date', :js, feature_category: :subgroups do - include Spec::Support::Helpers::Features::MembersHelpers - include Spec::Support::Helpers::Features::InviteMembersModalHelper + include Features::MembersHelpers + include Features::InviteMembersModalHelpers let_it_be(:user1) { create(:user, name: 'John Doe') } let_it_be(:group) { create(:group) } diff --git a/spec/features/groups/members/search_members_spec.rb b/spec/features/groups/members/search_members_spec.rb index 6b2896b194c..80de1cabd1e 100644 --- a/spec/features/groups/members/search_members_spec.rb +++ b/spec/features/groups/members/search_members_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe 'Search group member', :js, feature_category: :subgroups do - include Spec::Support::Helpers::Features::MembersHelpers + include Features::MembersHelpers let(:user) { create :user } let(:member) { create :user } diff --git a/spec/features/groups/members/sort_members_spec.rb b/spec/features/groups/members/sort_members_spec.rb index 5634122ec16..d2e5445deae 100644 --- a/spec/features/groups/members/sort_members_spec.rb +++ b/spec/features/groups/members/sort_members_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe 'Groups > Members > Sort members', :js, feature_category: :subgroups do - include Spec::Support::Helpers::Features::MembersHelpers + include Features::MembersHelpers let(:owner) { create(:user, name: 'John Doe', created_at: 5.days.ago, last_activity_on: Date.today) } let(:developer) { create(:user, name: 'Mary Jane', created_at: 1.day.ago, last_sign_in_at: 5.days.ago, last_activity_on: Date.today - 5) } @@ -18,7 +18,7 @@ RSpec.describe 'Groups > Members > Sort members', :js, feature_category: :subgro def expect_sort_by(text, sort_direction) within('[data-testid="members-sort-dropdown"]') do - expect(page).to have_css('button[aria-haspopup="true"]', text: text) + expect(page).to have_css('button[aria-haspopup="menu"]', text: text) expect(page).to have_button("Sorting Direction: #{sort_direction == :asc ? 'Ascending' : 'Descending'}") end end diff --git a/spec/features/groups/milestone_spec.rb b/spec/features/groups/milestone_spec.rb index a70a1e2e70b..376e1e6063f 100644 --- a/spec/features/groups/milestone_spec.rb +++ b/spec/features/groups/milestone_spec.rb @@ -25,17 +25,17 @@ RSpec.describe 'Group milestones', feature_category: :subgroups do description.native.send_keys('') - click_button('Preview') + click_button("Preview") preview = find('.js-md-preview') expect(preview).to have_content('Nothing to preview.') - click_button('Write') + click_button("Continue editing") description.native.send_keys(':+1: Nice') - click_button('Preview') + click_button("Preview") expect(preview).to have_css('gl-emoji') expect(find('#milestone_description', visible: false)).not_to be_visible diff --git a/spec/features/groups/milestones/milestone_editing_spec.rb b/spec/features/groups/milestones/milestone_editing_spec.rb new file mode 100644 index 00000000000..b3c7cfe88af --- /dev/null +++ b/spec/features/groups/milestones/milestone_editing_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe "Milestone editing", feature_category: :team_planning do + let_it_be(:group) { create(:group, owner: user) } + let_it_be(:user) { create(:group_member, :maintainer, user: create(:user), group: group).user } + + let(:milestone) { create(:milestone, group: group, title: "12345676543") } + + before do + sign_in(user) + + visit(edit_group_milestone_path(group, milestone)) + end + + it_behaves_like 'milestone handling version conflicts' +end diff --git a/spec/features/groups/new_group_page_spec.rb b/spec/features/groups/new_group_page_spec.rb index a07c27331d9..1efdc3fff07 100644 --- a/spec/features/groups/new_group_page_spec.rb +++ b/spec/features/groups/new_group_page_spec.rb @@ -3,15 +3,14 @@ require 'spec_helper' RSpec.describe 'New group page', :js, feature_category: :subgroups do - let(:user) { create(:user) } - let(:group) { create(:group) } + let_it_be(:user) { create(:user) } + let_it_be(:parent_group) { create(:group) } before do + parent_group.add_owner(user) sign_in(user) end - it_behaves_like 'a dashboard page with sidebar', :new_group_path, :groups - describe 'new top level group alert' do context 'when a user visits the new group page' do it 'shows the new top level group alert' do @@ -22,8 +21,6 @@ RSpec.describe 'New group page', :js, feature_category: :subgroups do end context 'when a user visits the new sub group page' do - let(:parent_group) { create(:group) } - it 'does not show the new top level group alert' do visit new_group_path(parent_id: parent_group.id, anchor: 'create-group-pane') @@ -31,4 +28,45 @@ RSpec.describe 'New group page', :js, feature_category: :subgroups do end end end + + describe 'sidebar' do + context 'in the current navigation' do + before do + user.update!(use_new_navigation: false) + end + + context 'for a new top-level group' do + it_behaves_like 'a "Your work" page with sidebar and breadcrumbs', :new_group_path, :groups + end + + context 'for a new subgroup' do + it 'shows the group sidebar of the parent group' do + visit new_group_path(parent_id: parent_group.id, anchor: 'create-group-pane') + expect(page).to have_selector( + ".nav-sidebar[aria-label=\"Group navigation\"] .context-header[title=\"#{parent_group.name}\"]" + ) + end + end + end + + context 'in the new navigation' do + before do + user.update!(use_new_navigation: true) + end + + context 'for a new top-level group' do + it 'shows the "Your work" navigation' do + visit new_group_path + expect(page).to have_selector(".super-sidebar .context-switcher-toggle", text: "Your work") + end + end + + context 'for a new subgroup' do + it 'shows the group navigation of the parent group' do + visit new_group_path(parent_id: parent_group.id, anchor: 'create-group-pane') + expect(page).to have_selector(".super-sidebar .context-switcher-toggle", text: parent_group.name) + end + end + end + end end diff --git a/spec/features/groups/packages_spec.rb b/spec/features/groups/packages_spec.rb index dd238657fbc..b7f9cd3e93a 100644 --- a/spec/features/groups/packages_spec.rb +++ b/spec/features/groups/packages_spec.rb @@ -37,8 +37,8 @@ RSpec.describe 'Group Packages', feature_category: :package_registry do end context 'when there are packages' do - let_it_be(:second_project) { create(:project, name: 'second-project', group: group) } - let_it_be(:npm_package) { create(:npm_package, project: project, name: 'zzz', created_at: 1.day.ago, version: '1.0.0') } + let_it_be(:second_project) { create(:project, group: group) } + let_it_be(:npm_package) { create(:npm_package, :with_build, project: project, name: 'zzz', created_at: 1.day.ago, version: '1.0.0') } let_it_be(:maven_package) { create(:maven_package, project: second_project, name: 'aaa', created_at: 2.days.ago, version: '2.0.0') } let_it_be(:packages) { [npm_package, maven_package] } @@ -47,10 +47,12 @@ RSpec.describe 'Group Packages', feature_category: :package_registry do it_behaves_like 'packages list', check_project_name: true + it_behaves_like 'pipelines on packages list' + it_behaves_like 'package details link' it 'allows you to navigate to the project page' do - find('[data-testid="root-link"]', text: project.name).click + find('[data-testid="root-link"]', text: project.path).click expect(page).to have_current_path(project_path(project)) expect(page).to have_content(project.name) diff --git a/spec/features/groups/settings/access_tokens_spec.rb b/spec/features/groups/settings/access_tokens_spec.rb index 1bee3be1ddb..cb92f9abdf5 100644 --- a/spec/features/groups/settings/access_tokens_spec.rb +++ b/spec/features/groups/settings/access_tokens_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Group > Settings > Access Tokens', :js, feature_category: :authentication_and_authorization do +RSpec.describe 'Group > Settings > Access Tokens', :js, feature_category: :system_access do include Spec::Support::Helpers::ModalHelpers let_it_be(:user) { create(:user) } diff --git a/spec/features/groups/settings/packages_and_registries_spec.rb b/spec/features/groups/settings/packages_and_registries_spec.rb index 80e2dcd5174..8ea8dc9219a 100644 --- a/spec/features/groups/settings/packages_and_registries_spec.rb +++ b/spec/features/groups/settings/packages_and_registries_spec.rb @@ -56,6 +56,15 @@ RSpec.describe 'Group Package and registry settings', feature_category: :package expect(sidebar).to have_link _('Packages and registries') end + it 'passes axe automated accessibility testing', :js do + visit_settings_page + + wait_for_requests + + expect(page).to be_axe_clean.within('[data-testid="packages-and-registries-group-settings"]') + .skipping :'link-in-text-block' + end + it 'has a Duplicate packages section', :js do visit_settings_page diff --git a/spec/features/groups/show_spec.rb b/spec/features/groups/show_spec.rb index 5cab79b40cf..0f936173e5d 100644 --- a/spec/features/groups/show_spec.rb +++ b/spec/features/groups/show_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe 'Group show page', feature_category: :subgroups do - include Spec::Support::Helpers::Features::InviteMembersModalHelper + include Features::InviteMembersModalHelpers let_it_be(:user) { create(:user) } let_it_be(:group) { create(:group) } |