Python+Selenium 测试报告优化
本次优化是基于网络共享模板(python 3.x): 1.界面排版优化 2.增加圆饼图统计 整体效果如图: 使用方式: report_path = os.path.join(os.getcwd(), r"testOutput\html\report.html") fp = open(report_path, "wb+") runner = HTMLTestRunner.HTMLTestReportCN( stream=fp, title=u'自动化测试报告', description='详细测试用例结果', # 不传默认为空 tester=u"tester" ) runner.run(allcase()) fp.close() 源码如下: 保存为<HTMLTestRunner.py> 存放于:C:\Python\Python37\Lib 目录下(具体目录以实际为准) #coding=utf-8 """ A TestRunner for use with the Python unit testing framework. It generates a HTML report to show the result at a glance. The simplest way to use this is to invoke its main method. E.g. import