Allure是一個獨立的報告插件,生成美觀易讀的報告
在Python3版本中,安裝Allure方法:
打開cmd,輸入pip install allure-pytest即安裝好了。
報告轉html工具安裝
allure-2.6.0.zip已經下載了,放在了E:\progromes\allure-2.7.0這個目錄下
將壓縮包內的bin目錄配置到path系統環境變量
在項目的使用
1, 配置文件中,
addopts = -s --alluredir=./report --reruns 0
2,進入report上級目錄,即點擊一下你的項目名,在Terminal中執行命令
allure generate report/ -o report/html --clean
等3秒左右,在提示下,輸入pytest
結果 report目錄下會生成index.html文件,即為可視化報告