blob: 907a6cb855845e1c4833de63cdba4c39a7e4d5c8 (
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
|
# frozen_string_literal: true
module QA
module Resource
class Pipeline < Base
attribute :project do
Resource::Project.fabricate! do |project|
project.name = 'project-with-pipeline'
end
end
attribute :id
attribute :status
attribute :ref
attribute :sha
# array in form
# [
# { key: 'UPLOAD_TO_S3', variable_type: 'file', value: true },
# { key: 'SOMETHING', variable_type: 'env_var', value: 'yes' }
# ]
attribute :variables
def initialize
@variables = []
end
def fabricate!
project.visit!
Page::Project::Menu.perform(&:click_ci_cd_pipelines)
Page::Project::Pipeline::Index.perform(&:click_run_pipeline_button)
Page::Project::Pipeline::New.perform(&:click_run_pipeline_button)
end
def ref
project.default_branch
end
def api_get_path
"/projects/#{project.id}/pipelines/#{id}"
end
def api_post_path
"/projects/#{project.id}/pipeline"
end
def api_post_body
{
ref: ref,
variables: variables
}
end
end
end
end
|