htmlrunner
HTMLRunner for unittest
Feature
- 日志
- 添加圖片
- [x] 順序執行/打亂執行
- [x] 多線程
- 失敗重試
- [x] 按日期命名
- 多語言
發送郵件- [x] 按測試類統計
- 統計圖
- [x] 執行時間
- [x] 超時時間設置
- [x] 環境信息
- 多次運行結果
- 性能分析
- 不穩定用例
- 標記bug
- 增加穩定性
- 異常解釋
- [x] extra信息
- [x] 自定義模板
- email支持格式
發送到飛書、釘釘、企業微信,短信(僅summary),Confluence(hook)- [x] 獲取代碼數據
- [x] tag實現
- [x] level實現
- [x] timeout實現
- [ ] 攔截請求和響應
Install
pip install htmlrunner
Simple Use
from htmlrunner import HTMLRunner
suite = unittest.defaultTestLoader.discover('.')
HTMLRunner(output="report_%Y%m%d_%H%M%S.html",
title="測試報告",
description="測試報告描述", tester='Hzc').run(suite)
Todo
- [ ] setup module timeout問題
- [x] not run test duration問題