allure

Posted autointerface

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了allure相关的知识,希望对你有一定的参考价值。

 

pip install pytest-allure-adaptor
.ini
--alluredir report
生成xml
https://bintray.com/qameta/generic/allure2 下载 allure-2.6.0.zip
配置到环境变量
report上级目录执行  allure generate report/ -o report/html --clean
report 目录下会生成 html 文件夹,html 下会有一个 index.html ,右键用浏览器打开即可。

 
@allure.step(title="测试步骤001")
allure.attach("输入", text, allure.attach_type.TEXT)
allure.attach("截图", self.driver.get_screenshot_as_png(), allure.attach_type.PNG)
@pytest.allure.severity(pytest.allure.severity_level.BLOCKER)

以上是关于allure的主要内容,如果未能解决你的问题,请参考以下文章