自帶的html報告
需要插件:pytest-html,第四章已經(jīng)安裝各個需要的插件了,請看第四章
生成報告命令:
pytest -vs --html=./report.html
allure級別的美觀報告:
配置:
1.官網(wǎng)下載allure
2.放到?jīng)]有中文的目錄下,把bin目錄配置到環(huán)境變量path下面
3.jdk安裝配置,也需要配置環(huán)境變量
4.重啟pycharm(不然剛配置后,可能還是無法調(diào)用,會出現(xiàn)亂碼報錯,坑了我一會)
生成報告:
1.生成臨時的json報告文件
pytest -vs --alluredir ./temp
2.通過臨時json文件生成html報告,但是不是特別美觀,需要定制化
import os
import pytest
if __name__ == '__main__':
pytest.main();
# 把temp目錄臨時json下文件生成到report空目錄下面
os.system("allure generate temp -o report --clean")
3.allure報告定制:我還在學(xué)習(xí)emmmm