Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
de1709a4
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
12 个月 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
de1709a4
编写于
8月 26, 2019
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
checkout cases by suite
上级
5337e6a1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
10 deletion
+25
-10
src/atf.go
src/atf.go
+1
-1
src/model/testing.go
src/model/testing.go
+15
-0
src/service/zentao/testcase.go
src/service/zentao/testcase.go
+9
-9
未找到文件。
src/atf.go
浏览文件 @
de1709a4
...
...
@@ -25,7 +25,7 @@ func main() {
flagSet
.
StringVar
(
&
dir
,
"d"
,
""
,
""
)
flagSet
.
Var
(
commonUtils
.
NewSliceValue
([]
string
{},
&
files
),
"f"
,
""
)
flagSet
.
StringVar
(
&
productId
,
"p"
,
"
.
"
,
""
)
flagSet
.
StringVar
(
&
productId
,
"p"
,
""
,
""
)
flagSet
.
StringVar
(
&
moduleId
,
"m"
,
""
,
""
)
flagSet
.
StringVar
(
&
taskId
,
"t"
,
""
,
""
)
flagSet
.
StringVar
(
&
suite
,
"s"
,
""
,
""
)
...
...
src/model/testing.go
浏览文件 @
de1709a4
...
...
@@ -12,6 +12,21 @@ type Module struct {
Name
string
}
type
TestSuite
struct
{
Id
int
Code
string
Name
string
Product
string
Cases
map
[
int
]
TestCaseInSuite
}
type
TestCaseInSuite
struct
{
Id
string
Title
string
Product
string
}
type
TestTask
struct
{
Id
int
Code
string
...
...
src/service/zentao/testcase.go
浏览文件 @
de1709a4
...
...
@@ -68,22 +68,22 @@ func ListCaseByProduct(baseUrl string, productId string, moduleId string) []mode
return
nil
}
func
ListCaseBy
Task
(
baseUrl
string
,
task
Id
string
)
[]
model
.
TestCase
{
params
:=
fmt
.
Sprintf
(
"%s-
all-0-id_asc-0-10000-1"
,
task
Id
)
func
ListCaseBy
Suite
(
baseUrl
string
,
suite
Id
string
)
[]
model
.
TestCase
{
params
:=
fmt
.
Sprintf
(
"%s-
id_asc-0-10000-1"
,
suite
Id
)
url
:=
baseUrl
+
zentaoUtils
.
GenApiUri
(
"test
task"
,
"cases
"
,
params
)
url
:=
baseUrl
+
zentaoUtils
.
GenApiUri
(
"test
suite"
,
"view
"
,
params
)
dataStr
,
ok
:=
client
.
Get
(
url
,
nil
)
if
ok
{
var
task
model
.
TestTask
json
.
Unmarshal
([]
byte
(
dataStr
),
&
task
)
var
suite
model
.
TestSuite
json
.
Unmarshal
([]
byte
(
dataStr
),
&
suite
)
caseArr
:=
make
([]
model
.
TestCase
,
0
)
for
_
,
cs
:=
range
task
.
Run
s
{
caseId
:=
cs
.
Case
for
_
,
cs
:=
range
suite
.
Case
s
{
caseId
:=
cs
.
Id
csWithSteps
:=
GetCaseById
(
baseUrl
,
caseId
)
caseArr
=
append
(
caseArr
,
model
.
TestCase
{
Id
:
caseId
,
Product
:
cs
.
Product
Id
,
caseArr
=
append
(
caseArr
,
model
.
TestCase
{
Id
:
caseId
,
Product
:
cs
.
Product
,
Title
:
cs
.
Title
,
StepArr
:
csWithSteps
.
StepArr
})
}
...
...
@@ -93,7 +93,7 @@ func ListCaseByTask(baseUrl string, taskId string) []model.TestCase {
return
nil
}
func
ListCaseBy
Suite
(
baseUrl
string
,
suiteId
string
)
[]
model
.
TestCase
{
func
ListCaseBy
Task
(
baseUrl
string
,
suiteId
string
)
[]
model
.
TestCase
{
params
:=
fmt
.
Sprintf
(
"%s-all-0-id_asc-0-10000-1"
,
suiteId
)
url
:=
baseUrl
+
zentaoUtils
.
GenApiUri
(
"testtask"
,
"cases"
,
params
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录