Allure - yml测试报告
Allure测试报告
生成pytest-html报告
1.首先在testcase同级创建一个report文件夹
2.在cmd的项目目录中输入:hrun testcase --html=./report/report.html(这种情况下,css和html是分开的两个文件)

hrun testcase --html=./report/report.html --self-contained-html(css和html是一个文件)
3.report中生成report.html文件
pytest testcase --html=./report/report.html --self-contained-html
pytest --html=./report/report.html --self-contained-html(执行项目中所有的test开头或结尾的py文件)
生成报告时,用pytest命令执行,hrun命令生成报告有bug
Allure环境准备与生成报告
allure-pytest环境准备
pip安装allure-pytest
pip install allure-pytest
allure-pytest和pytest-allure-adaptor不能共存,用其中一个需要卸载掉另一个
jdk环境配置
allure环境配置:path中加入allure的路径
验证:
命令行输入:allure

切换到文件目录下,输入:pytest --alluredir ./report/allure_report

之后输入:allure serve ./report/allure_report

