1、框架包含的内容
-
- 失败重运行
- aliure测试报告
- 并发执行
2、pytest安装
3、终端运行pytest
4、为什么用pytest
5、使用pytest设置
6、编写测试用例的方法
7、收集用例pytest和unittest的区别
pytest自动收集,unittest需要运行程序,比如说discover等代码
8、运行用例的三种方式
9、生成报告
setting -类似pytest安装,搜索pytest,安装pytest-html
pytest.main(['--html=output.html']) ---用的不多
多的是allure平台
10、安装allure
1、 pip install allure-pytest
2、下载服务: allure-commandline https://github.com/allure-framework/allure
3、安装平台的服务 下载后解压,复制bin路径, 配置环境变量 bin目录的路径放在path下面,记得重启电脑
生成测试报告:使⽤ pytest.main(['--alluredir=report']) report是目录
终端执行命令, allure serve report # report是目录