安裝allure-pytest
https://docs.qameta.io/allure/#_pytest
pip install allure-pytest
要使Allure偵聽器能夠在測試執行過程中收集結果,隻需添加
--alluredir
選項并提供路徑即可存儲結果。
pytest --alluredir=f:\py_test
執行pytest輸出結果
生成報告:要在測試完成後檢視實際報告,您需要使用Allure指令行實用程式從結果生成報告。記得将IE全局代理給關掉,否則無法顯示報告。
allure serve f:\py_test