常用命令

1. 通过har文件生成测试用例

1.1 使用 har文件生成 pytest 测试用例
har2case har/postman-echo-post-form.har
1.2 使用 har文件生成 json 格式的测试用例
har2case har/postman-echo-post-form.har -2j
1.3 使用 har文件生成 yaml 格式的测试用例
har2case har/postman-echo-post-form.har -2y

2. 运行测试用例的方法

2.1 运行 pytest 测试用例的方法(两个运行效果一致)
hrun testcases/postman_echo_post_form_test.py 
pytest testcases/postman_echo_post_form_test.py 
2.2 运行 json 测试用例的方法
hrun testcases/postman-echo-post-form.json
2.3 运行 yaml 测试用例的方法
hrun testcases/postman_echo_post_form.yaml

3. 测试用例格式转换

3.1 将yaml测试用例转换成为pytest测试用例
hmake testcases/demo_testcase_ref.yml
3.2 将json测试用例转换成为pytest测试用例
hmake testcases/demo_testcase_ref.json
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容