debian-mirror-gitlab/spec/features/projects/active_tabs_spec.rb

207 lines
5.1 KiB
Ruby
Raw Permalink Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2018-05-09 12:01:36 +05:30
require 'spec_helper'
2023-03-04 22:38:38 +05:30
RSpec.describe 'Project active tab', feature_category: :projects do
2022-07-16 23:28:13 +05:30
let_it_be(:project) { create(:project, :repository, :with_namespace_settings) }
2021-06-08 01:23:25 +05:30
2022-04-04 11:22:00 +05:30
let(:user) { project.first_owner }
2018-05-09 12:01:36 +05:30
before do
sign_in(user)
end
def click_tab(title)
page.within '.sidebar-top-level-items > .active' do
click_link(title)
end
end
context 'on project Home' do
2021-09-04 01:27:46 +05:30
it 'activates Project scope menu' do
visit project_path(project)
2021-06-08 01:23:25 +05:30
2021-09-04 01:27:46 +05:30
expect(page).to have_selector('.sidebar-top-level-items > li.active', count: 1)
expect(find('.sidebar-top-level-items > li.active')).to have_content(project.name)
2018-05-09 12:01:36 +05:30
end
2021-09-04 01:27:46 +05:30
end
2018-05-09 12:01:36 +05:30
2021-09-04 01:27:46 +05:30
context 'on Project information' do
context 'default link' do
2018-05-09 12:01:36 +05:30
before do
2021-06-08 01:23:25 +05:30
visit project_path(project)
2021-09-04 01:27:46 +05:30
click_link('Project information', match: :first)
end
it_behaves_like 'page has active tab', 'Project'
it_behaves_like 'page has active sub tab', 'Activity'
end
context 'on Project information/Activity' do
before do
visit activity_project_path(project)
2018-05-09 12:01:36 +05:30
end
2018-11-08 19:23:39 +05:30
it_behaves_like 'page has active tab', 'Project'
2018-05-09 12:01:36 +05:30
it_behaves_like 'page has active sub tab', 'Activity'
end
end
context 'on project Repository' do
before do
root_ref = project.repository.root_ref
visit project_tree_path(project, root_ref)
end
it_behaves_like 'page has active tab', 'Repository'
2020-04-08 14:13:33 +05:30
%w(Files Commits Graph Compare Branches Tags).each do |sub_menu|
2018-05-09 12:01:36 +05:30
context "on project Repository/#{sub_menu}" do
before do
click_tab(sub_menu)
end
it_behaves_like 'page has active tab', 'Repository'
it_behaves_like 'page has active sub tab', sub_menu
end
end
end
context 'on project Issues' do
before do
visit project_issues_path(project)
end
it_behaves_like 'page has active tab', 'Issues'
2021-06-08 01:23:25 +05:30
context "on project Issues/Milestones" do
before do
click_tab('Milestones')
end
2018-05-09 12:01:36 +05:30
2021-06-08 01:23:25 +05:30
it_behaves_like 'page has active tab', 'Issues'
it_behaves_like 'page has active sub tab', 'Milestones'
end
2018-05-09 12:01:36 +05:30
end
context 'on project Merge Requests' do
before do
visit project_merge_requests_path(project)
end
2021-04-29 21:17:54 +05:30
it_behaves_like 'page has active tab', 'Merge requests'
2018-05-09 12:01:36 +05:30
end
context 'on project Wiki' do
before do
2020-06-23 00:09:42 +05:30
visit wiki_path(project.wiki)
2018-05-09 12:01:36 +05:30
end
it_behaves_like 'page has active tab', 'Wiki'
end
context 'on project Members' do
before do
visit project_project_members_path(project)
end
it_behaves_like 'page has active tab', 'Members'
end
context 'on project Settings' do
before do
visit edit_project_path(project)
end
context 'on project Settings/Integrations' do
before do
click_tab('Integrations')
end
it_behaves_like 'page has active tab', 'Settings'
it_behaves_like 'page has active sub tab', 'Integrations'
end
context 'on project Settings/Repository' do
before do
click_tab('Repository')
end
it_behaves_like 'page has active tab', 'Settings'
it_behaves_like 'page has active sub tab', 'Repository'
end
end
2020-03-13 15:44:24 +05:30
2020-04-08 14:13:33 +05:30
context 'on project Analytics' do
2020-03-13 15:44:24 +05:30
before do
2021-02-22 17:27:13 +05:30
visit project_cycle_analytics_path(project)
2020-03-13 15:44:24 +05:30
end
2021-09-30 23:02:18 +05:30
context 'on project Analytics/Value stream Analytics' do
2020-04-08 14:13:33 +05:30
it_behaves_like 'page has active tab', _('Analytics')
2021-09-30 23:02:18 +05:30
it_behaves_like 'page has active sub tab', _('Value stream')
2020-04-08 14:13:33 +05:30
end
2020-03-13 15:44:24 +05:30
2021-04-17 20:07:23 +05:30
context 'on project Analytics/"CI/CD"' do
2020-04-08 14:13:33 +05:30
before do
2021-04-17 20:07:23 +05:30
click_tab(_('CI/CD'))
2020-03-13 15:44:24 +05:30
end
2020-04-08 14:13:33 +05:30
it_behaves_like 'page has active tab', _('Analytics')
2021-04-17 20:07:23 +05:30
it_behaves_like 'page has active sub tab', _('CI/CD')
2020-03-13 15:44:24 +05:30
end
end
2021-09-04 01:27:46 +05:30
context 'on project CI/CD' do
context 'browsing Pipelines tabs' do
let_it_be(:pipeline) { create(:ci_pipeline, project: project) }
context 'Pipeline tab' do
before do
visit project_pipeline_path(project, pipeline)
end
it_behaves_like 'page has active tab', _('CI/CD')
it_behaves_like 'page has active sub tab', _('Pipelines')
end
context 'Needs tab' do
before do
visit dag_project_pipeline_path(project, pipeline)
end
it_behaves_like 'page has active tab', _('CI/CD')
it_behaves_like 'page has active sub tab', _('Pipelines')
end
context 'Builds tab' do
before do
visit builds_project_pipeline_path(project, pipeline)
end
it_behaves_like 'page has active tab', _('CI/CD')
it_behaves_like 'page has active sub tab', _('Pipelines')
end
context 'Failures tab' do
before do
visit failures_project_pipeline_path(project, pipeline)
end
it_behaves_like 'page has active tab', _('CI/CD')
it_behaves_like 'page has active sub tab', _('Pipelines')
end
context 'Test Report tab' do
before do
visit test_report_project_pipeline_path(project, pipeline)
end
it_behaves_like 'page has active tab', _('CI/CD')
it_behaves_like 'page has active sub tab', _('Pipelines')
end
end
end
2018-05-09 12:01:36 +05:30
end