Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
ff7cb657
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,体验更适合开发者的 AI 搜索 >>
提交
ff7cb657
编写于
9月 01, 2019
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
show failed case list for selection when committing bug
上级
a89f1844
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
49 addition
and
10 deletion
+49
-10
res/messages_en.json
res/messages_en.json
+5
-0
res/messages_zh.json
res/messages_zh.json
+6
-0
src/action/bug.go
src/action/bug.go
+33
-5
src/atf.go
src/atf.go
+4
-4
src/utils/const/const.go
src/utils/const/const.go
+1
-1
未找到文件。
res/messages_en.json
浏览文件 @
ff7cb657
...
...
@@ -81,6 +81,11 @@
"message"
:
"enter co language"
,
"translation"
:
"select script language. %s"
},
{
"id"
:
"enter_case_id_for_report_bug"
,
"message"
:
""
,
"translation"
:
"which case do you want to report bug for? enter case id, 'exit' to quit"
},
{
"id"
:
"invalid_input"
,
...
...
res/messages_zh.json
浏览文件 @
ff7cb657
...
...
@@ -76,6 +76,12 @@
"message"
:
"enter co language"
,
"translation"
:
"请选择脚本语言。 %s"
},
{
"id"
:
"enter_case_id_for_report_bug"
,
"message"
:
""
,
"translation"
:
"请输入您想提交缺陷的用例编号,输入'exit'退出"
},
{
"id"
:
"invalid_input"
,
"message"
:
"invalid input"
,
...
...
src/action/bug.go
浏览文件 @
ff7cb657
package
action
import
(
"fmt"
testingService
"github.com/easysoft/zentaoatf/src/service/testing"
"github.com/easysoft/zentaoatf/src/ui/page"
configUtils
"github.com/easysoft/zentaoatf/src/utils/config"
constant
"github.com/easysoft/zentaoatf/src/utils/const"
fileUtils
"github.com/easysoft/zentaoatf/src/utils/file"
i118Utils
"github.com/easysoft/zentaoatf/src/utils/i118"
logUtils
"github.com/easysoft/zentaoatf/src/utils/log"
"github.com/fatih/color"
"os"
"regexp"
)
func
CommitBug
(
files
[]
string
,
caseId
string
)
{
func
CommitBug
(
files
[]
string
)
{
var
resultDir
string
if
len
(
files
)
>
0
{
resultDir
=
files
[
0
]
...
...
@@ -15,9 +23,29 @@ func CommitBug(files []string, caseId string) {
}
resultDir
=
fileUtils
.
UpdateDir
(
resultDir
)
if
caseId
==
""
{
configUtils
.
ConfigForInt
(
&
caseId
,
"test_case"
)
}
report
:=
testingService
.
GetTestTestReportForSubmit
(
resultDir
)
for
{
var
caseId
string
page
.
CuiReportBug
(
"logs/2019-08-30T130258/"
,
"1"
)
logUtils
.
PrintToStdOut
(
i118Utils
.
I118Prt
.
Sprint
(
"enter_case_id_for_report_bug"
),
color
.
FgCyan
)
for
_
,
cs
:=
range
report
.
Cases
{
if
cs
.
Status
!=
constant
.
PASS
.
String
()
{
logUtils
.
PrintToStdOut
(
fmt
.
Sprintf
(
"
\n
%d. %s %s"
,
cs
.
Id
,
cs
.
Title
,
logUtils
.
ColoredStatus
(
cs
.
Status
)),
color
.
FgCyan
)
}
}
fmt
.
Scanln
(
&
caseId
)
if
caseId
==
"exit"
{
os
.
Exit
(
1
)
}
else
{
pass
,
_
:=
regexp
.
MatchString
(
"^
\\
d+$"
,
caseId
)
if
pass
{
page
.
CuiReportBug
(
resultDir
,
caseId
)
}
else
{
logUtils
.
PrintToStdOut
(
i118Utils
.
I118Prt
.
Sprint
(
"invalid_input"
),
color
.
FgRed
)
}
}
}
}
src/atf.go
浏览文件 @
ff7cb657
...
...
@@ -19,7 +19,7 @@ func main() {
var
moduleId
string
var
taskId
string
var
suiteId
string
var
caseId
string
//
var caseId string
flagSet
:=
flag
.
NewFlagSet
(
"atf"
,
flag
.
ContinueOnError
)
...
...
@@ -46,8 +46,8 @@ func main() {
flagSet
.
StringVar
(
&
keywords
,
"k"
,
""
,
""
)
flagSet
.
StringVar
(
&
keywords
,
"keywords"
,
""
,
""
)
flagSet
.
StringVar
(
&
caseId
,
"c"
,
""
,
""
)
flagSet
.
StringVar
(
&
caseId
,
"case"
,
""
,
""
)
//
flagSet.StringVar(&caseId, "c", "", "")
//
flagSet.StringVar(&caseId, "case", "", "")
var
placeholder
string
flagSet
.
StringVar
(
&
placeholder
,
"h"
,
""
,
""
)
...
...
@@ -91,7 +91,7 @@ func main() {
case
"cb"
:
files
,
idx
:=
fileUtils
.
GetFilesFromParams
(
os
.
Args
[
2
:
])
if
err
:=
flagSet
.
Parse
(
os
.
Args
[
idx
+
1
:
]);
err
==
nil
{
action
.
CommitBug
(
files
,
caseId
)
action
.
CommitBug
(
files
)
}
case
"list"
,
"ls"
,
"-l"
:
...
...
src/utils/const/const.go
浏览文件 @
ff7cb657
...
...
@@ -67,7 +67,7 @@ var (
$>atf.exe ci tc01.py 将脚本里面修改的用例信息,同步到禅道系统。
$>atf.exe cr logs/2019-08-28T164819 提交测试结果到禅道系统。
$>atf.exe cb logs/2019-08-28T164819
-case 1 将编号为1的用例结果提交为缺陷,缩写-c
。
$>atf.exe cb logs/2019-08-28T164819
提交测试结果中失败用例为缺陷
。
$>atf.exe list dir1 . 列出目录dir1,以及当前目录下的所有脚本文件。
$>atf.exe view tc01.py tc02.py 查看指定路径的测试脚本。
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录