Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
5337e6a1
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
5337e6a1
编写于
8月 26, 2019
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
save productID in script file
上级
4aac1c63
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
7 deletion
+6
-7
src/model/testing.go
src/model/testing.go
+2
-2
src/service/script/generator.go
src/service/script/generator.go
+1
-2
src/service/zentao/testcase.go
src/service/zentao/testcase.go
+3
-3
未找到文件。
src/model/testing.go
浏览文件 @
5337e6a1
...
...
@@ -30,8 +30,8 @@ type TestCaseInTask struct {
}
type
TestCase
struct
{
Id
string
Product
Id
string
Id
string
Product
string
Title
string
Steps
map
[
int
]
TestStep
...
...
src/service/script/generator.go
浏览文件 @
5337e6a1
...
...
@@ -26,7 +26,7 @@ func Generate(testcases []model.TestCase, langType string, independentFile bool)
func
GenerateTestCaseScript
(
cs
model
.
TestCase
,
langType
string
,
independentFile
bool
,
caseIds
*
[]
string
)
{
caseId
:=
cs
.
Id
productId
:=
cs
.
Product
Id
productId
:=
cs
.
Product
caseTitle
:=
cs
.
Title
scriptFile
:=
fmt
.
Sprintf
(
constant
.
ScriptDir
+
"tc-%s.%s"
,
caseId
,
LangMap
[
langType
][
"extName"
])
...
...
@@ -50,7 +50,6 @@ func GenerateTestCaseScript(cs model.TestCase, langType string, independentFile
if
fileUtils
.
FileExist
(
scriptFile
)
{
// update title and steps
content
:=
fileUtils
.
ReadFile
(
scriptFile
)
fmt
.
Println
(
content
)
// replace title
re
,
_
:=
regexp
.
Compile
(
`title:\s*([^\n]*?)\s*\n`
)
...
...
src/service/zentao/testcase.go
浏览文件 @
5337e6a1
...
...
@@ -59,7 +59,7 @@ func ListCaseByProduct(baseUrl string, productId string, moduleId string) []mode
tc
:=
caseMap
[
idStr
]
csWithSteps
:=
GetCaseById
(
baseUrl
,
idStr
)
caseArr
=
append
(
caseArr
,
model
.
TestCase
{
Id
:
idStr
,
Product
Id
:
tc
.
ProductId
,
Title
:
tc
.
Title
,
StepArr
:
csWithSteps
.
StepArr
})
caseArr
=
append
(
caseArr
,
model
.
TestCase
{
Id
:
idStr
,
Product
:
tc
.
Product
,
Title
:
tc
.
Title
,
StepArr
:
csWithSteps
.
StepArr
})
}
return
caseArr
...
...
@@ -83,7 +83,7 @@ func ListCaseByTask(baseUrl string, taskId string) []model.TestCase {
caseId
:=
cs
.
Case
csWithSteps
:=
GetCaseById
(
baseUrl
,
caseId
)
caseArr
=
append
(
caseArr
,
model
.
TestCase
{
Id
:
caseId
,
Product
Id
:
cs
.
ProductId
,
caseArr
=
append
(
caseArr
,
model
.
TestCase
{
Id
:
caseId
,
Product
:
cs
.
ProductId
,
Title
:
cs
.
Title
,
StepArr
:
csWithSteps
.
StepArr
})
}
...
...
@@ -108,7 +108,7 @@ func ListCaseBySuite(baseUrl string, suiteId string) []model.TestCase {
caseId
:=
cs
.
Case
csWithSteps
:=
GetCaseById
(
baseUrl
,
caseId
)
caseArr
=
append
(
caseArr
,
model
.
TestCase
{
Id
:
caseId
,
Product
Id
:
cs
.
ProductId
,
caseArr
=
append
(
caseArr
,
model
.
TestCase
{
Id
:
caseId
,
Product
:
cs
.
ProductId
,
Title
:
cs
.
Title
,
StepArr
:
csWithSteps
.
StepArr
})
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录