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

format test script content

上级 835c3fe7
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/zentaoatf.iml" filepath="$PROJECT_DIR$/.idea/zentaoatf.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/src/golang.org/x/text" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
......@@ -44,7 +44,7 @@ func DealwithTestCase(tc model.TestCase, langType string, independentExpect bool
}
template := utils.ReadFile("xdoc/script-template.txt")
content := string(fmt.Sprintf(string(template), langType, caseTitle, caseId,
content := string(fmt.Sprintf(string(template), langType, caseId, caseTitle,
strings.Join(steps, "\n"), expectsTxt, strings.Join(srcCode, "\n")))
fmt.Println(content)
......@@ -100,7 +100,7 @@ func DealwithTestStep(ts model.TestStep, langType string, level int, stepWidth i
expectsLine := ""
expectsLine = "# \n"
expectsLine += "/* " + stepIdent + " 期望结果, 可以有多行 */\n"
expectsLine += "/* " + stepIdent + "期望结果, 可以有多行 */\n"
*expects = append(*expects, expectsLine)
}
......@@ -115,7 +115,7 @@ func DealwithTestStep(ts model.TestStep, langType string, level int, stepWidth i
codeLine += `println("#")\n`
}
codeLine += " // 开始" + stepIdent + " - " + stepExpect + "\n"
codeLine += " // " + stepIdent + ": " + stepExpect + "\n"
codeLine += "/* 输出验证点实际结果 */\n"
*srcCode = append(*srcCode, codeLine)
......
TODO:
\ No newline at end of file
<?%s
<<<TC
title: %s
caseId: %d
steps: @开头的为含验证点的步骤
CaseId: %d
Title: %s
Steps: @开头的为含验证点的步骤
%s
expects:
%s
readme:
- 脚本输出日志和expects章节中,#号标注的验证点需保持一致对应
- 具体自动化测试样例,请参考http://
TC;
/* 此处编写操作步骤代码 */
......
<?php
<<<TC
title: 用户登录
caseId: 100
steps: @开头的为含验证点的步骤
CaseId: 100
Title: 用户登录
Steps: @开头的为含验证点的步骤
step1000 打开登录页面
step1010 输入正确的用户名和密码
@step1020 点击'登录'按钮
expects:
#
/* @step1020 期望结果, 可以有多行 */
/* @step1020期望结果, 可以有多行 */
readme:
1. 脚本输出日志和expects章节中,#号标注的验证点需保持一致对应
TC;
/* 此处编写操作步骤代码 */
echo "#\n"; // 开始@step1020 - 用户成功登录
echo "#\n"; // @step1020: 用户成功登录
/* 输出验证点实际结果 */
?>
<?php
<<<TC
title: 登录失败账号锁定策略
caseId: 200
steps: @开头的为含验证点的步骤
CaseId: 200
Title: 登录失败账号锁定策略
Steps: @开头的为含验证点的步骤
step2000 连续输入3次错误的密码
@step2010 第4次尝试登录
group2100 不连续输入3次错误的密码
......@@ -13,19 +13,22 @@ steps: @开头的为含验证点的步骤
expects:
#
/* @step2010 期望结果, 可以有多行 */
/* @step2010期望结果, 可以有多行 */
#
/* @step2104 期望结果, 可以有多行 */
/* @step2104期望结果, 可以有多行 */
readme:
1. 脚本输出日志和expects章节中,#号标注的验证点需保持一致对应
TC;
/* 此处编写操作步骤代码 */
echo "#\n"; // 开始@step2010 - 系统提示账号被锁定
echo "#\n"; // @step2010: 系统提示账号被锁定
/* 输出验证点实际结果 */
echo "#\n"; // 开始@step2104 - 登录成功,账号未被锁定
echo "#\n"; // @step2104: 登录成功,账号未被锁定
/* 输出验证点实际结果 */
?>
<?php
<<<TC
title: 注册
caseId: 300
steps: @开头的为含验证点的步骤
CaseId: 300
Title: 注册
Steps: @开头的为含验证点的步骤
expects:
readme:
1. 脚本输出日志和expects章节中,#号标注的验证点需保持一致对应
TC;
/* 此处编写操作步骤代码 */
......
<?php
<<<TC
title: 忘记密码
caseId: 400
steps: @开头的为含验证点的步骤
CaseId: 400
Title: 忘记密码
Steps: @开头的为含验证点的步骤
expects:
readme:
1. 脚本输出日志和expects章节中,#号标注的验证点需保持一致对应
TC;
/* 此处编写操作步骤代码 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册