File: user_views_project_artifacts_page_spec.rb

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (40 lines) | stat: -rw-r--r-- 1,416 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# frozen_string_literal: true

require "spec_helper"

RSpec.describe 'User views project artifacts page', :js, feature_category: :job_artifacts do
  let_it_be(:project) { create(:project, :public) }
  let_it_be(:pipeline) { create(:ci_empty_pipeline, project: project) }
  let_it_be(:job_with_artifacts) { create(:ci_build, :artifacts, name: 'test1', pipeline: pipeline) }
  let_it_be(:job_with_trace) { create(:ci_build, :trace_artifact, name: 'test3', pipeline: pipeline) }
  let_it_be(:job_without_artifacts) { create(:ci_build, name: 'test2', pipeline: pipeline) }

  let(:path) { project_artifacts_path(project) }

  context 'when browsing artifacts page' do
    before do
      visit(path)

      wait_for_requests
    end

    it 'lists the project jobs and their artifacts' do
      page.within('main#content-body') do
        page.within('table thead') do
          expect(page).to have_content('Artifacts')
            .and have_content('Job')
            .and have_content('Size')
        end

        find_all('[data-testid="job-artifacts-count"').each(&:click)

        expect(page).to have_content(job_with_artifacts.name)
        expect(page).to have_content(job_with_trace.name)
        expect(page).not_to have_content(job_without_artifacts.name)

        expect(page).to have_content('archive').and have_content('metadata')
        expect(page).to have_content('trace')
      end
    end
  end
end