生成allure测试报告:
下载:pip install allure-pytest
下载jdk
配置Java环境
配置pytest.ini
[pytest]
addopts = -s -v --html=report/report.html --alluredir ./report/result
testpaths = ./scripts
python_files = test_case.py
python_classes = Test*
python_functions = test_*
xfail_strict = true
cmd命令行执行:
allure generate report/result -o report/allure_html
页面效果如下:
清空掉之前的并生成新的测试报告:
allure generate report/result -o report/allure_html --clean