-
Notifications
You must be signed in to change notification settings - Fork 375
/
testplan_case_rel.go
185 lines (156 loc) · 6.07 KB
/
testplan_case_rel.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
// Copyright (c) 2021 Terminus, Inc.
//
// This program is free software: you can use, redistribute, and/or modify
// it under the terms of the GNU Affero General Public License, version 3
// or later ("AGPL"), as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package apistructs
import (
"time"
)
// TestPlanCaseRel
type TestPlanCaseRel struct {
ID uint64 `json:"id"`
Name string `json:"name"`
Priority TestCasePriority `json:"priority"`
TestPlanID uint64 `json:"testPlanID"`
TestSetID uint64 `json:"testSetID"`
TestCaseID uint64 `json:"testCaseID"`
ExecStatus TestCaseExecStatus `json:"execStatus"`
CreatorID string `json:"creatorID"`
UpdaterID string `json:"updaterID"`
ExecutorID string `json:"executorID"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
APICount TestCaseAPICount `json:"apiCount"`
IssueBugs []TestPlanCaseRelIssueBug `json:"issueBugs"`
}
type TestPlanCaseRelIssueBug struct {
IssueRelationID uint64 `json:"issueRelationID"`
IssueID uint64 `json:"issueID"`
IterationID int64 `json:"iterationID"`
Title string `json:"title"`
State IssueState `json:"state"`
StateBelong IssueStateBelong `json:"stateBelong"`
Priority IssuePriority `json:"priority"`
CreatedAt time.Time `json:"createdAt"`
}
// TestCaseExecStatus 测试用例执行状态
type TestCaseExecStatus string
const (
CaseExecStatusInit TestCaseExecStatus = "INIT" // 未执行
CaseExecStatusSucc TestCaseExecStatus = "PASSED" // 已通过
CaseExecStatusFail TestCaseExecStatus = "FAIL" // 未通过
CaseExecStatusBlocked TestCaseExecStatus = "BLOCK" // 阻塞
)
// TestPlanCaseRelCreateRequest 测试计划用例关系创建请求
type TestPlanCaseRelCreateRequest struct {
TestPlanID uint64 `json:"testPlanID"`
TestCaseIDs []uint64 `json:"testCaseIDs"`
// 若 TestSetIDs 不为空,则添加测试集下所有测试用例到测试集下,与 TestCaseIDs 取合集
TestSetIDs []uint64 `json:"testSetIDs"`
IdentityInfo
}
type TestPlanCaseRelCreateResponse struct {
Header
Data *TestPlanCaseRelCreateResult `json:"data,omitempty"`
}
type TestPlanCaseRelCreateResult struct {
TotalCount uint64 `json:"totalCount"`
}
type TestPlanCaseRelGetRequest struct {
RelationID uint64 `json:"relationID"`
}
type TestPlanCaseRelGetResponse struct {
Header
Data *TestPlanCaseRel `json:"data"`
}
// TestPlanCaseRelBatchUpdateRequest 测试计划用例关系更新请求
type TestPlanCaseRelBatchUpdateRequest struct {
Delete bool `json:"delete"`
ExecutorID string `json:"executorID"`
ExecStatus TestCaseExecStatus `json:"execStatus"`
TestPlanID uint64 `json:"-"`
TestSetID *uint64 `json:"testSetID"` // 批量递归操作测试集下的所有关联;与 relationIDs 的关系为 并集
RelationIDs []uint64 `json:"relationIDs"`
ProjectID uint64 `json:"-"`
IdentityInfo
}
// TestPlanTestCaseRelDeleteRequest 测试计划用例关系删除请求
type TestPlanTestCaseRelDeleteRequest struct {
// +required
ProjectID uint64 `json:"projectId"`
// +required
TestPlanID uint64 `json:"testPlanId"`
UsecaseIDs []uint64 `json:"usecaseIds"`
ExcludeIDs []uint64 `json:"excludeIds"`
AllSelected bool `json:"allSelected"` // 为 true 时,usecaseIDs 为空
IdentityInfo
}
// TestPlanCaseRelListRequest 测试计划用户关系列表请求
type TestPlanCaseRelListRequest struct {
IDs []uint64 `schema:"id"`
TestPlanIDs []uint64 `schema:"testPlanID"`
TestSetIDs []uint64 `schema:"testSetID"`
CreatorIDs []string `schema:"creatorID"`
UpdaterIDs []string `schema:"updaterID"`
ExecutorIDs []string `schema:"executorID"`
ExecStatuses []TestCaseExecStatus `schema:"execStatus"`
UpdatedAtBeginInclude *time.Time
UpdatedAtEndInclude *time.Time
IDOnly bool
IdentityInfo
}
// TestPlanCaseRelListResponse 测试计划测试用例关系响应
type TestPlanCaseRelListResponse struct {
Header
Data []TestPlanCaseRel `json:"data"`
}
// TestPlanCaseRelExportRequest 测试计划用例导出请求
type TestPlanCaseRelExportRequest struct {
TestPlanCaseRelPagingRequest
Locale string `schema:"-"`
FileType TestCaseFileType `schema:"fileType"`
}
type TestPlanCaseRelExportResponse struct {
Header
Data int64 `json:"data"`
}
// TestPlanReportGenerateResponse 测试计划报告生成响应
type TestPlanReportGenerateResponse struct {
Header
Data *TestPlanReport `json:"data"`
}
type TestPlanReport struct {
TestPlan TestPlan `json:"testPlan"`
RelsCount TestPlanRelsCount `json:"relsCount"`
APICount TestCaseAPICount `json:"apiCount"`
ExecutorStatus map[string]TestPlanRelsCount `json:"executorStatus"`
UserIDs []string `json:"userIDs"`
}
// TestPlanCaseRelIssueRelationRemoveRequest 解除测试计划用例与缺陷关联关系请求
type TestPlanCaseRelIssueRelationRemoveRequest struct {
IssueTestCaseRelationIDs []uint64 `json:"issueTestCaseRelationIDs"`
TestPlanID uint64 `json:"-"`
TestPlanCaseRelID uint64 `json:"-"`
IdentityInfo
}
type TestPlanCaseRelIssueRelationRemoveResponse struct {
Header
}
// TestPlanCaseRelIssueRelationAddRequest 新增测试计划用例与缺陷关联关系请求
type TestPlanCaseRelIssueRelationAddRequest struct {
IssueIDs []uint64 `json:"issueIDs"`
TestPlanID uint64 `json:"-"`
TestPlanCaseRelID uint64 `json:"-"`
IdentityInfo
}
type TestPlanCaseRelIssueRelationAddResponse struct {
Header
}