测试报告在软件开发和质量保证过程中扮演着至关重要的角色。它不仅是测试活动的总结和记录,也是项目交付的关键文档之一,为项目的成功实施提供了有力的保障;能够给出一份漂亮的测试报告也是体现测试能力的一部分;以下将对自动化测试中如何引用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 是测试报告存储位置)
自动化测试之allure美化测试报告
于 2023-05-31 17:09:11 首次发布