allure美化测试报告

一.allure下载安装
下载地址:https://repo.maven.apache.org/maven2/io/qameta/allure
下载下来安装包后,把安装包放到一个位置后配置环境变量
在这里插入图片描述
高级系统设置–环境变量–path中把allure包中bin的路径配置上
在这里插入图片描述
二.在python环境中安装相关库
在python环境中执行以下命令
pip install allure-pytest
pip install pytest
pip install pytest-html
pip install pytest-xdist
pip install pytest-ordering
pip install pytest-rerunfailures
在这里插入图片描述
三.生成报告命令
生成每条测试用例报告:
pytest -vs --alluredir=./result/report(./result/report 是测试报告存储位置)
生成整体测试报告:
allure serve ./result/report(./result/report 是测试报告存储位置)