pytest allure 测试报告

文件编辑时间 2019-11-05

使用 allure-pytest ,使用 allure-pytest, 使用 allure-pytest

pip3 install allure-pytest

或者在ide里面直接搜索安装

下载 allure2

allure-commandline-x.x.x.zip
https://github.com/allure-framework/allure2/releases
解压文件,将bin文件夹路径配置path环境变量
D:\allure\allure-2.13.0\bin , 根据解压位置更改路径地址

使用

if name=="main":
pytest.main(['-s','-q','--alluredir','report/result','xx.py'])

-- report/result 为运行结果相对的存放位置
-- xx.py 为测试脚本

最后

allure generate ../../report/json/ -o ../../report/html/allure --clean

../../report/json/为第三步中生成的结果的目录地址
../../report/html/allure 为生成测试报告的目录地址

待完善。。。

posted @ 2019-11-05 17:13  Lozz  阅读(160)  评论(0)    收藏  举报