Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
17d627c8
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
10 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
17d627c8
编写于
12月 16, 2020
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
not to print no-cases msg, if login failed
上级
c0230f57
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
14 addition
and
11 deletion
+14
-11
conf/ztf.conf
conf/ztf.conf
+1
-1
res/messages_en.json
res/messages_en.json
+1
-1
res/messages_zh.json
res/messages_zh.json
+1
-1
src/action/gen.go
src/action/gen.go
+4
-2
src/service/client/http.go
src/service/client/http.go
+3
-1
src/service/zentao/testcase.go
src/service/zentao/testcase.go
+4
-5
未找到文件。
conf/ztf.conf
浏览文件 @
17d627c8
...
...
@@ -2,7 +2,7 @@ Version = 1
Language
=
zh
Url
=
http
://
zentaopms
.
ngtesting
.
com
/
Account
=
admin
Password
=
P2ssw0rd
1
Password
=
P2ssw0rd
Javascript
=
Lua
=
Perl
=
...
...
res/messages_en.json
浏览文件 @
17d627c8
...
...
@@ -236,7 +236,7 @@
},
{
"id"
:
"no_cases"
,
"translation"
:
"No test cases
found
."
"translation"
:
"No test cases."
},
{
...
...
res/messages_zh.json
浏览文件 @
17d627c8
...
...
@@ -230,7 +230,7 @@
},
{
"id"
:
"no_cases"
,
"translation"
:
"未
发现
测试用例。"
"translation"
:
"未
找到
测试用例。"
},
{
"id"
:
"success_to_login"
,
...
...
src/action/gen.go
浏览文件 @
17d627c8
...
...
@@ -29,7 +29,7 @@ func Generate(productId string, moduleId string, suiteId string, taskId string,
return
}
cases
:=
zentaoService
.
LoadTestCases
(
productId
,
moduleId
,
suiteId
,
taskId
)
cases
,
loginFail
:=
zentaoService
.
LoadTestCases
(
productId
,
moduleId
,
suiteId
,
taskId
)
if
cases
!=
nil
&&
len
(
cases
)
>
0
{
productId
=
cases
[
0
]
.
Product
...
...
@@ -62,6 +62,8 @@ func Generate(productId string, moduleId string, suiteId string, taskId string,
logUtils
.
PrintToWithColor
(
err
.
Error
(),
color
.
FgRed
)
}
}
else
{
logUtils
.
PrintToWithColor
(
i118Utils
.
I118Prt
.
Sprintf
(
"no_cases"
),
color
.
FgRed
)
if
!
loginFail
{
logUtils
.
PrintToWithColor
(
i118Utils
.
I118Prt
.
Sprintf
(
"no_cases"
),
color
.
FgRed
)
}
}
}
src/service/client/http.go
浏览文件 @
17d627c8
...
...
@@ -199,7 +199,9 @@ func PostStr(url string, params map[string]string) (msg string, ok bool) {
jsonErr
:=
json
.
Unmarshal
(
bodyStr
,
&
bodyJson
)
if
jsonErr
!=
nil
{
if
vari
.
Verbose
{
logUtils
.
PrintToCmd
(
jsonErr
.
Error
(),
color
.
FgRed
)
if
strings
.
Index
(
url
,
"login"
)
==
-
1
{
// ignore jsonErr caused by login request return a html
logUtils
.
PrintToCmd
(
jsonErr
.
Error
(),
color
.
FgRed
)
}
}
ok
=
false
return
...
...
src/service/zentao/testcase.go
浏览文件 @
17d627c8
...
...
@@ -19,14 +19,13 @@ import (
"strings"
)
func
LoadTestCases
(
productIdStr
,
moduleIdStr
,
suiteIdStr
,
taskIdStr
string
)
[]
model
.
TestCase
{
func
LoadTestCases
(
productIdStr
,
moduleIdStr
,
suiteIdStr
,
taskIdStr
string
)
(
testcases
[]
model
.
TestCase
,
loginFail
bool
)
{
config
:=
configUtils
.
ReadCurrConfig
()
var
testcases
[]
model
.
TestCase
ok
:=
Login
(
config
.
Url
,
config
.
Account
,
config
.
Password
)
if
!
ok
{
return
testcases
loginFail
=
true
return
}
if
moduleIdStr
!=
""
{
...
...
@@ -41,7 +40,7 @@ func LoadTestCases(productIdStr, moduleIdStr, suiteIdStr, taskIdStr string) []mo
logUtils
.
PrintUsage
()
}
return
testcases
return
}
func
ListCaseByProduct
(
baseUrl
string
,
productId
string
)
[]
model
.
TestCase
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录