blob: 8352ad6aa33efce1e14e6ceb87335f4df9970c2b (
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
|
# frozen_string_literal: true
module QA
RSpec.describe 'Verify' do
describe 'Pipeline with prefill variables' do
let(:prefill_variable_description1) { Faker::Lorem.sentence }
let(:prefill_variable_value1) { Faker::Lorem.word }
let(:prefill_variable_description2) { Faker::Lorem.sentence }
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'project-with-prefill-variables'
end
end
let!(:commit) 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
variables:
TEST1:
value: #{prefill_variable_value1}
description: #{prefill_variable_description1}
TEST2:
description: #{prefill_variable_description2}
TEST3:
value: test 3 value
TEST4: test 4 value
test:
script: echo "$FOO"
YAML
}
]
)
end
end
before do
Flow::Login.sign_in
project.visit!
# Navigate to Run Pipeline page
Page::Project::Menu.perform(&:click_ci_cd_pipelines)
Page::Project::Pipeline::Index.perform(&:click_run_pipeline_button)
end
it(
'shows only variables with description as prefill variables on the run pipeline page',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/371204'
) do
Page::Project::Pipeline::New.perform do |new|
aggregate_failures do
expect(new).to have_field('Input variable key', with: 'TEST1')
expect(new).to have_field('Input variable value', with: prefill_variable_value1)
expect(new).to have_content(prefill_variable_description1)
expect(new).to have_field('Input variable key', with: 'TEST2')
expect(new).to have_content(prefill_variable_description2)
expect(new).not_to have_field('Input variable key', with: 'TEST3')
expect(new).not_to have_field('Input variable key', with: 'TEST4')
end
end
end
end
end
end
|