1. 安装
1.1 安装
pip install httprunner
hrun -V
1.2 相关文档
+ github:https://github.com/httprunner/httprunner
+ 官方⽂档:https://docs.httprunner.org/
+ 中文文档:https://ontheway.cool/HttpRunner3DocsForCN/
+ 2.x和3.x区别:https://www.cnblogs.com/yoyoketang/p/15009395.html
2. 创建项目
2.1 创建工程
创建脚手架
httprunner startproject HrunDemo
2.2 目录结构
tree HrunDemo -a
├── .env
├── .gitignore
├── debugtalk.py
├── har
├── logs
├── reports
└── testcases
├── __init__.py
├── demo_testcase_ref.yml
├── demo_testcase_ref_test.py
├── demo_testcase_request.yml
└── demo_testcase_request_test.py
3. 使用引导
- step1: 保存或导出har文件到har目录下
- step2 : 生成pytest标准测试文件
har2case har/demo.har
hrun har/demo_test.py
har2case har/demo.har -2j
har2case har/demo.har -2y
hrun har/demo.json
hrun har/demo.yml
4. 开发拓展
https://v2.httprunner.org/