1.先安装allure-pytest需要的插件
#allure
pip3 install allure-pytest -i Simple Index --trusted-host pypi.douban.com
#pytest
pip3 install pytest -i Simple Index --trusted-host pypi.douban.com
2.去GitHub下载最新版Releases · allure-framework/allure2 · GitHub
然后将allure的安装bin路径添加到系统的path环境变量中去
3.执行生成报告的命令
pytest -n auto --alluredir=allure
这样报告会在项目目录下的allure文件夹中存储,但是是一堆json、txt文件
使用 allure serve allure 命令,可以在默认浏览器中打开可视化的测试报告