httprunner3.x詳細教程八(測試報告)
**歡迎加入測試交流群:自動化測試-夜行者(816489363)進行交流學習QAQ** --成都-阿木木
1、使用pytest-html生成測試報告
安裝pytest-html插件 pip install pytest-html
執行命令:hrun testcasesPath --html=path/report.html
2、使用allure生成測試報告的兩種方式:
allure生成測試報告前,需要生成測試結果:
hrun testcasePath --allure=resultPath(測試結果存放路徑)
生成測試報告的第一種方式,會生成靜態資源文件,通過靜態資源index.html地址訪問:
allure generate resultPath -o reportPath
生成測試報告的第二種方式,不會生成靜態資源文件,啟動一個web服務,提供ip和port在線訪問:
$ allure serve resultPath