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

i118 test script templates

上级 4c57113d
......@@ -152,6 +152,26 @@
"message": "Sample to use: ",
"translation": "Sample to use: "
},
{
"id": "is_checkpoint",
"message": "Step begin with '@' has checkpoint",
"translation": "Step begin with '@' has checkpoint"
},
{
"id": "your_codes_here",
"message": "Write your codes here",
"translation": "Write your codes here"
},
{
"id": "expect_result_here",
"message": "Expect Results",
"translation": "Expect Results, can be more than one line"
},
{
"id": "actual_result_here",
"message": "Record actual results",
"translation": "Record actual results"
},
{
"id": "success_to_generate",
"message": "success to generate %d test scripts in '%s'",
......
......@@ -150,6 +150,26 @@
"message": "Sample to use: ",
"translation": "使用示例"
},
{
"id": "is_checkpoint",
"message": "Step begin with '@' has checkpoint",
"translation": "@开头的为含验证点的步骤"
},
{
"id": "your_codes_here",
"message": "Write your codes here",
"translation": "此处编写操作步骤代码"
},
{
"id": "expect_result_here",
"message": "Expect Results",
"translation": "期望结果, 可以有多行"
},
{
"id": "actual_result_here",
"message": "Record actual results",
"translation": "输出验证点实际结果"
},
{
"id": "success_to_generate",
"message": "success to generate %d test scripts in '%s'",
......
- Print '#' in test log to match up with the ones in expects section
- Write test scripts to replace the lines begin with 'CODE'
- More examples, pls refer to https://github.com/easysoft/zentaoatf/tree/master/xdoc/sample
\ No newline at end of file
- 脚本输出日志,同expects章节中#号标注的验证点需保持一致对应
- Logs of test scripts,must expects章节中#号标注的验证点需保持一致对应
- 脚本中CODE打头的注释需用代码替换
- 参考样例https://github.com/easysoft/zentaoatf/tree/master/xdoc/sample
\ No newline at end of file
......@@ -66,12 +66,13 @@ func GenerateTestCaseScript(cs model.TestCase, langType string, independentFile
expects := make([]string, 0)
srcCode := make([]string, 0)
steps = append(steps, "@开头的为含验证点的步骤")
steps = append(steps, i118Utils.I118Prt.Sprintf("is_checkpoint"))
temp := fmt.Sprintf("\n%sCODE: 此处编写操作步骤代码\n", LangMap[langType]["commentsTag"])
temp := fmt.Sprintf("\n%sCODE: %s\n", LangMap[langType]["commentsTag"],
i118Utils.I118Prt.Sprintf("your_codes_here"))
srcCode = append(srcCode, temp)
readme := zentaoUtils.ReadResData("res/template/readme.tpl") + "\n"
readme := zentaoUtils.ReadResData("res/template/readme-"+vari.Prefer.Language+".tpl") + "\n"
StepWidth := 20
stepDisplayMaxWidth := 0
......@@ -146,7 +147,7 @@ func GenerateTestStepScript(ts model.TestStep, langType string, stepWidth int,
expectsLine := ""
expectsLine = "# " + stepIdent + " \n"
expectsLine += "CODE: " + "期望结果, 可以有多行\n"
expectsLine += "CODE: " + i118Utils.I118Prt.Sprintf("expect_result_here") + " \n"
*expects = append(*expects, expectsLine)
}
......@@ -157,7 +158,7 @@ func GenerateTestStepScript(ts model.TestStep, langType string, stepWidth int,
codeLine += fmt.Sprintf(" %s %s: %s\n", LangMap[langType]["commentsTag"], stepIdent, stepExpect)
codeLine += LangMap[langType]["commentsTag"] + "CODE: 输出验证点实际结果\n"
codeLine += LangMap[langType]["commentsTag"] + "CODE: " + i118Utils.I118Prt.Sprintf("actual_result_here") + "\n"
*srcCode = append(*srcCode, codeLine)
}
......
TODO:
\ No newline at end of file
package main
/*
<<<TC
caseId: %s
caseIdInTask: %s
taskId: %s
title: %s
steps: %s
expects:
%s
readme:
%s
TC;
*/
func main() {
%s
}
\ No newline at end of file
#!/usr/bin/env python3
'''
<<TC
caseId: %s
caseIdInTask: %s
taskId: %s
title: %s
steps: %s
expects:
%s
readme:
%s
TC
'''
%s
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册