blob: 588d22275df2d3c0b0781db5d7ff7ae57464fe04 (
plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
# frozen_string_literal: true
module QA
RSpec.describe 'Verify', :runner, :requires_admin, product_group: :pipeline_insights do
describe 'Artifacts' do
context 'when locked' do
let(:file_name) { 'artifact.txt' }
let(:directory_name) { 'my_artifacts' }
let(:executor) { "qa-runner-#{Time.now.to_i}" }
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'project-with-locked-artifacts'
end
end
let!(:runner) do
Resource::ProjectRunner.fabricate! do |runner|
runner.project = project
runner.name = executor
runner.tags = [executor]
end
end
before do
Flow::Login.sign_in
end
after do
runner.remove_via_api!
end
it 'can be browsed', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348003' do
Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = project
commit.commit_message = 'Add .gitlab-ci.yml'
commit.add_files(
[
{
file_path: '.gitlab-ci.yml',
content: <<~YAML
test-artifacts:
tags:
- '#{executor}'
artifacts:
paths:
- '#{directory_name}'
expire_in: 1 sec
script:
- |
mkdir #{directory_name}
echo "CONTENTS" > #{directory_name}/#{file_name}
YAML
}
]
)
end.project.visit!
Flow::Pipeline.visit_latest_pipeline
Page::Project::Pipeline::Show.perform do |pipeline|
pipeline.click_job('test-artifacts')
end
Page::Project::Job::Show.perform do |show|
expect(show).to have_browse_button
show.click_browse_button
end
Page::Project::Artifact::Show.perform do |show|
show.go_to_directory(directory_name)
expect(show).to have_content(file_name)
end
end
end
end
end
end
|