参数化三种方式
- 引用 CSV 文件
- 直接指定参数列表
- 调用 debugtalk.py 中自定义的函数生成参数列表
1.1 新建csv
1.2 关联参数
1.3 引用 CSV 文件
然后在 测试用例集中,就可以通过内置的 parameterize(可简写为 P)函数引用 CSV 文件。
1.4 执行测试
hrun ./testsuites/department.yml
2.直接指定参数列表
3.自定义的函数生成参数列表
在 debugtalk.py 中定义函数 get_id,生成指定数量的参数列表。
在测试集的 parameters 中就调用自定义函数生成指定数量的参数列表。