forked from Goldenteamway/allure-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.go
123 lines (102 loc) · 2.07 KB
/
options.go
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package allure
import (
"github.com/Jacky-zxj/allure-go/severity"
)
type Option func(r hasOptions)
func ID(id string) Option {
return func(r hasOptions) {
r.addLabel("AS_ID", id)
}
}
func Lead(lead string) Option {
return func(r hasOptions) {
r.addLabel("lead", lead)
}
}
func Owner(owner string) Option {
return func(r hasOptions) {
r.addLabel("owner", owner)
}
}
func Epic(epic string) Option {
return func(r hasOptions) {
r.addLabel("epic", epic)
}
}
func Severity(severity severity.Severity) Option {
return func(r hasOptions) {
r.addLabel("severity", string(severity))
}
}
func Story(story string) Option {
return func(r hasOptions) {
r.addLabel("story", story)
}
}
func Feature(feature string) Option {
return func(r hasOptions) {
r.addLabel("feature", feature)
}
}
func Tag(tag string) Option {
return func(r hasOptions) {
r.addLabel("tag", tag)
}
}
func Tags(tags ...string) Option {
return func(r hasOptions) {
for _, tag := range tags {
r.addLabel("tag", tag)
}
}
}
func Parameter(name string, value interface{}) Option {
return func(r hasOptions) {
r.addParameter(name, value)
}
}
func Parameters(parameters map[string]interface{}) Option {
return func(r hasOptions) {
r.addParameters(parameters)
}
}
func Description(description string) Option {
return func(r hasOptions) {
r.addDescription(description)
}
}
func Action(action func()) Option {
return func(r hasOptions) {
r.addAction(action)
}
}
func Reason(reason string) Option {
return func(r hasOptions) {
r.addReason(reason)
}
}
func Name(name string) Option {
return func(r hasOptions) {
r.addName(name)
}
}
func Suite(suite string) Option {
return func(r hasOptions) {
r.addLabel("suite", suite)
}
}
func SubSuite(subSuite string) Option {
return func(r hasOptions) {
r.addLabel("subSuite", subSuite)
}
}
func ParentSuite(parentSuite string) Option {
return func(r hasOptions) {
r.addLabel("parentSuite", parentSuite)
}
}
func Label(labelName string, labelValue string) Option {
return func(r hasOptions) {
r.addLabel(labelName, labelValue)
}
}