blob: 1a2d450f7eb8a95ebb19f0be86c92b208a6a7523 (
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
79
80
81
82
83
84
85
86
87
88
|
# frozen_string_literal: true
module QA
RSpec.describe 'Verify' do
describe 'Pipeline editor', :requires_admin do
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'pipeline-editor-project'
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: default_file_content
}
]
)
end
end
let!(:production_push) do
Resource::Repository::Push.fabricate! do |push|
push.repository_http_uri = project.repository_http_location.uri
push.branch_name = 'production'
push.file_name = '.gitlab-ci.yml'
push.file_content = production_file_content
end
end
let(:default_file_content) do
<<~YAML
stages:
- test
initialize:
stage: test
script:
- echo "initialized in #{project.default_branch}"
YAML
end
let(:production_file_content) do
<<~YAML
stages:
- test
initialize:
stage: test
script:
- echo "initialized in production"
YAML
end
before do
Flow::Login.sign_in
project.visit!
Page::Project::Menu.perform(&:go_to_pipeline_editor)
end
after do
project.remove_via_api!
Page::Main::Menu.perform(&:sign_out)
end
it 'can switch branches and target branch field updates accordingly', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1891' do
Page::Project::PipelineEditor::Show.perform do |show|
expect(show).to have_branch_selector_button
show.click_branch_selector_button
show.select_branch_from_dropdown(production_push.branch_name)
expect(show.target_branch_name).to eq(production_push.branch_name)
show.click_branch_selector_button
show.select_branch_from_dropdown(project.default_branch)
expect(show.target_branch_name).to eq(project.default_branch)
end
end
end
end
end
|