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

use yaml to save properties like language etc.

上级 e2af7326
language: en
......@@ -25,9 +25,7 @@ func GetInst() Config {
}
func InitConfig() {
config := Config{}
buf, _ := ioutil.ReadFile("config.yaml")
yaml.Unmarshal(buf, &config)
config := GetInst()
fmt.Println(color.BlueString("current config %+v", config))
......@@ -36,7 +34,7 @@ func InitConfig() {
}
func Set(param string, val string) {
buf, _ := ioutil.ReadFile("config.yaml")
buf, _ := ioutil.ReadFile(ConfigFile)
yaml.Unmarshal(buf, &config)
if param == "lang" {
......
......@@ -7,5 +7,5 @@ const (
LanguageEN = "en"
LanguageZH = "zh"
ConfigFile = "config.yaml"
ConfigFile = "conf.yaml"
)
<?%s
<<<TC
title: with multi lines.
caseId: %d
steps:
@group1:
step1.1
step1.2
step1.3
@step2
step3
@step4
expects:
#
expect line1 point 1
expect line2 point 1
#
expect for point 2
#
expect for point 3
TC;
echo '#';
scriptsForPoint1();
echo '#';
scriptsForPoint2();
echo '#';
scriptsForPoint3();
?>
<?%s
<<<TC
caseId: 100
title: 用户登录
steps:
-
id: step1000 # 可省略
name: 打开登录页面
-
id: step1010
name: 输入正确的用户名和密码
-
id: step1020
name: 点击'登录'按钮
checkpoint: true
expects:
-
stepId: step1020 # 可省略,数量和steps中对应上即可
expect: # @step1020期望结果, 可以有多行
readme:
- 脚本输出日志和expects章节中,#号标注的验证点需保持一致对应
- 脚本中/* */标注的需用代码替换,//注解的为说明文字
- 参考样例https://github.com/easysoft/zentaoatf/tree/master/xdoc/sample
TC;
echo '#';
scriptsForPoint1();
echo '#';
scriptsForPoint2();
echo '#';
scriptsForPoint3();
?>
......@@ -3,9 +3,9 @@
caseId: 100
title: 用户登录
steps: @开头的为含验证点的步骤
step1000 打开登录页面
step1010 输入正确的用户名和密码
@step1020 点击'登录'按钮
1000 打开登录页面
1010 输入正确的用户名和密码
@1020 点击'登录'按钮
expects:
#
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册