大家好,我是杨叔。每天进步一点点,关注微信公众号【程序员杨叔】,了解更多测试开发技术知识!
一、背景
虽然pytest自带有pytest-html报告,但很多时候我们需要更全面、更炫酷的测试报告,因此本文主要介绍pytest框架下Allure的使用,希望能帮助你快速生成炫酷的自动化测试报告。
二、安装
1、下载Allure
Github地址:https://github.com/allure-framework/allure2/releases
下载完成后解压到本地,并把bin目录添加到环境变量:
cmd下输入:allure --version,能正常获取说明allure环境变量配置成功。
2、安装Allure Pytest Plugin
allure-pytest是Pytest的一个插件,通过它我们可以生成Allure所需要的用于生成测试报告的数据。安装allure-pytest插件方法:
pip install allu