提交 dbed31bf 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

test on win7

上级 41c0fb7c
...@@ -29,6 +29,7 @@ github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALr ...@@ -29,6 +29,7 @@ github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALr
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
github.com/keybase/go-ps v0.0.0-20161005175911-668c8856d999 h1:2d+FLQbz4xRTi36DO1qYNUwfORax9XcQ0jhbO81Vago= github.com/keybase/go-ps v0.0.0-20161005175911-668c8856d999 h1:2d+FLQbz4xRTi36DO1qYNUwfORax9XcQ0jhbO81Vago=
github.com/keybase/go-ps v0.0.0-20161005175911-668c8856d999/go.mod h1:hY+WOq6m2FpbvyrI93sMaypsttvaIL5nhVR92dTMUcQ= github.com/keybase/go-ps v0.0.0-20161005175911-668c8856d999/go.mod h1:hY+WOq6m2FpbvyrI93sMaypsttvaIL5nhVR92dTMUcQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f h1:sgUSP4zdTUZYZgAGGtN5Lxk92rK+JUFOwf+FT99EEI4= github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f h1:sgUSP4zdTUZYZgAGGtN5Lxk92rK+JUFOwf+FT99EEI4=
github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f/go.mod h1:UGmTpUd3rjbtfIpwAPrcfmGf/Z1HS95TATB+m57TPB8= github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f/go.mod h1:UGmTpUd3rjbtfIpwAPrcfmGf/Z1HS95TATB+m57TPB8=
......
...@@ -145,6 +145,11 @@ ...@@ -145,6 +145,11 @@
"message": "only en(%s) and zh(%s) language is acceptable", "message": "only en(%s) and zh(%s) language is acceptable",
"translation": "only en(%s) and zh(%s) language is acceptable" "translation": "only en(%s) and zh(%s) language is acceptable"
}, },
{
"id": "no_cases",
"message": "No test cases found",
"translation": "No test cases found"
},
{ {
"id": "no_scripts", "id": "no_scripts",
"message": "No test scripts found", "message": "No test scripts found",
......
...@@ -133,6 +133,11 @@ ...@@ -133,6 +133,11 @@
"message": "只支持语言en(%s)和zh(%s)", "message": "只支持语言en(%s)和zh(%s)",
"translation": "只支持语言en(%s)和zh(%s)" "translation": "只支持语言en(%s)和zh(%s)"
}, },
{
"id": "no_cases",
"message": "No test cases found",
"translation": "No test cases found"
},
{ {
"id": "no_scripts", "id": "no_scripts",
"message": "No test scripts found", "message": "No test scripts found",
......
此差异已折叠。
...@@ -29,15 +29,19 @@ func Generate(productId string, moduleId string, suiteId string, taskId string, ...@@ -29,15 +29,19 @@ func Generate(productId string, moduleId string, suiteId string, taskId string,
} }
cases := zentaoService.LoadTestCases(productId, moduleId, suiteId, taskId) cases := zentaoService.LoadTestCases(productId, moduleId, suiteId, taskId)
productId = cases[0].Product
zentaoService.GetCaseModules(productId)
if cases != nil { if cases != nil && len(cases) > 0 {
productId = cases[0].Product
zentaoService.GetCaseModules(productId)
count, err := scriptService.Generate(cases, scriptLang, independentFile) count, err := scriptService.Generate(cases, scriptLang, independentFile)
if err == nil { if err == nil {
logUtils.PrintToCmd(i118Utils.I118Prt.Sprintf("success_to_generate", count, constant.ScriptDir)+"\n", -1) logUtils.PrintToCmd(i118Utils.I118Prt.Sprintf("success_to_generate", count, constant.ScriptDir)+"\n", -1)
} else { } else {
logUtils.PrintToCmd(err.Error(), color.FgRed) logUtils.PrintToCmd(err.Error(), color.FgRed)
} }
} else {
logUtils.PrintToCmd(i118Utils.I118Prt.Sprintf("no_cases"), color.FgRed)
} }
} }
...@@ -43,8 +43,6 @@ func Run(files []string, suiteIdStr string, taskIdStr string) { ...@@ -43,8 +43,6 @@ func Run(files []string, suiteIdStr string, taskIdStr string) {
scriptService.GetScriptByIdsInDir(files[0], caseIdMap, &cases) scriptService.GetScriptByIdsInDir(files[0], caseIdMap, &cases)
} else { // no suiteId, taskId param } else { // no suiteId, taskId param
aa := path.Ext(files[1])
_ = aa
if len(files) > 1 && fileUtils.IsDir(files[0]) && if len(files) > 1 && fileUtils.IsDir(files[0]) &&
path.Ext(files[1]) == "."+constant.ExtNameSuite { // run suite file path.Ext(files[1]) == "."+constant.ExtNameSuite { // run suite file
......
...@@ -37,19 +37,19 @@ var ( ...@@ -37,19 +37,19 @@ var (
RequestTypePathInfo = "PATH_INFO" RequestTypePathInfo = "PATH_INFO"
Usage = ` help -h 查看帮助信息。 Usage = ` help -h 查看帮助信息。
set -s 设置语言、禅道系统同步参数。 set -s 设置语言、禅道系统同步参数。用户对当前目录需要有写权限。
co checkout 导出禅道系统中的用例,已存在的将更新标题和步骤描述。可指定产品、套件、测试单编号。 co checkout 导出禅道系统中的用例,已存在的将更新标题和步骤描述。可指定产品、套件、测试单编号。
up update 从禅道系统更新已存在的用例。可指定产品、模块、套件、测试单编号。 up update 从禅道系统更新已存在的用例。可指定产品、模块、套件、测试单编号。
run -r 执行测试用例。可指定目录、套件、脚本、结果文件的路径,以及套件和任务的编号,多个文件间用空格隔开。 run -r 执行测试用例。可指定目录、套件、脚本、结果文件的路径,以及套件和任务的编号,多个文件间用空格隔开。
ci 将脚本中修改的用例信息,同步到禅道系统。 ci 将脚本中修改的用例信息,同步到禅道系统。
cr 将用例执行结果提交到禅道系统中。 cr 将用例执行结果提交到禅道系统中。
cb 将执行结果中的失败用例,作为缺陷提交到餐到系统。可指定测试日志目录和用例编号,弹出命令行图形界面 cb 将执行结果中的失败用例,作为缺陷提交到禅道系统
list ls -l 查看测试用例列表。可指定目录和文件的列表,之间用空格隔开。 list ls -l 查看测试用例列表。可指定目录和文件的列表,之间用空格隔开。
view -v 查看测试用例详情。可指定目录和文件的列表,之间用空格隔开。` view -v 查看测试用例详情。可指定目录和文件的列表,之间用空格隔开。`
Example = ` $>atf.exe run scripts-demo\tc-01.bat 执行演示测试用例,非windows系统请使用tc-01.sh脚本。 Example = ` $>atf.exe run scripts-demo\tc-01.bat 执行演示测试用例,非windows系统请使用tc-01.sh脚本。
$>atf.exe set 根据系统提示,设置语言、禅道系统地址、账号和密码参数。 $>atf.exe set 根据系统提示,设置语言、禅道系统地址、账号和密码参数。
可使用测试数据 http://ruiyinxin.test.zentao.netautotest01 / P2ssw0rd 可使用测试数据 http://ruiyinxin.test.zentao.net autotest01 / P2ssw0rd
$>atf.exe co 交互式导出禅道测试用例,将提示用户输入导出类型和编号。 $>atf.exe co 交互式导出禅道测试用例,将提示用户输入导出类型和编号。
$>atf.exe co -product 1 -language python 导出编号为1的产品测试用例,使用python语言,缩写-p -l。 $>atf.exe co -product 1 -language python 导出编号为1的产品测试用例,使用python语言,缩写-p -l。
$>atf.exe co -p 1 -m 15 -l python 导出产品编号为1、模块编号为16的测试用例。 $>atf.exe co -p 1 -m 15 -l python 导出产品编号为1、模块编号为16的测试用例。
......
...@@ -148,6 +148,7 @@ func getInput(regx string, fmtStr string, params ...interface{}) string { ...@@ -148,6 +148,7 @@ func getInput(regx string, fmtStr string, params ...interface{}) string {
if pass { if pass {
return ret return ret
} else { } else {
ret = ""
logUtils.PrintToStdOut(i118Utils.I118Prt.Sprintf(msg), color.FgRed) logUtils.PrintToStdOut(i118Utils.I118Prt.Sprintf(msg), color.FgRed)
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册