goversky / htmltestrunner_cn Goto Github PK
View Code? Open in Web Editor NEWThis project forked from tungwaiyip/htmltestrunner
HTMLTestRunner 汉化版,同时支持python 2和3,增加截图展示功能,失败重试
This project forked from tungwaiyip/htmltestrunner
HTMLTestRunner 汉化版,同时支持python 2和3,增加截图展示功能,失败重试
D:\Anaconda\python.exe D:/xinjian/run_this.py
<unittest.suite.TestSuite tests=[<unittest.suite.TestSuite tests=[<unittest.suite.TestSuite tests=[<testcase1.Test_ranzhi testMethod=test_case1>]>]>]>
E test_case1 (testcase1.Test_ranzhi)
Traceback (most recent call last):
File "D:/xinjian/run_this.py", line 23, in
run.run(discover)
File "D:\xinjian\common\HTMLTestRunner_jpg.py", line 746, in run
test(result)
File "D:\Anaconda\lib\unittest\suite.py", line 84, in call
return self.run(*args, **kwds)
File "D:\Anaconda\lib\unittest\suite.py", line 122, in run
test(result)
File "D:\Anaconda\lib\unittest\suite.py", line 84, in call
return self.run(*args, **kwds)
File "D:\Anaconda\lib\unittest\suite.py", line 122, in run
test(result)
File "D:\Anaconda\lib\unittest\suite.py", line 84, in call
return self.run(*args, **kwds)
File "D:\Anaconda\lib\unittest\suite.py", line 122, in run
test(result)
File "D:\Anaconda\lib\unittest\case.py", line 653, in call
retesting... 1
return self.run(*args, **kwds)
File "D:\Anaconda\lib\unittest\case.py", line 624, in run
result.stopTest(self)
File "D:\xinjian\common\HTMLTestRunner_jpg.py", line 659, in stopTest
if doc.find('_retry')!=-1:
AttributeError: 'NoneType' object has no attribute 'find'
Process finished with exit code 1
新版本生成的测试报告,饼图不显示, 点击详情无法展开, 点击截图无法显示, 点击报告其它链接都没效果
用你项目的脚本执行生成的测试报告也是一样的问题
我用的是python3.7.1, 有关系?
另外, 代码中的'<>'会报错是不是要替换成'!='?
if isinstance(e, str):
# ue = unicode(e.encode('string_escape'))
if PY3K:
ue = e
elif e.find("Error") != -1 or e.find("Exception") <> -1:
es = e.decode('utf-8', 'ignore').split('\n')
try:
if es[-2].find("\u") <> -1 or es[-2].find('"\u') <> -1:
es[-2] = es[-2].decode('unicode_escape')
except Exception:
pass
ue = u"\n".join(es)
else:
ue = e.decode('utf-8', 'ignore')
else:
ue = e
我试了下,截图是看不到的
如果将driver放到setupclass中,则无法使用ddt模块
说明文档中提到:
在python3 中因为unittest运行机制变动,在使用setUp/tearDown中初始化/退出driver时,会出现用例执行失败没有截图的问题,所以推荐使用样例中setUpClass/tearDownClass的用法
如果想在setUp/tearDown中初始化/退出driver可以截图,这个问题有什么办法解决吗?我使用setUpClass/tearDownClass的用法,当一个类里面有多个用例时,截到的图是不准确的,并不是在失败位置的截图。
Traceback (most recent call last):
File "D:/machine_Learning/machine_pycharm/untitled/CommonSdk/ScreenShot/Report.py", line 177, in
runer.run(suiteAll)
File "D:\machine_Learning\Lib\HTMLTestRunner_cn.py", line 888, in run
self.generateReport(test, result)
File "D:\machine_Learning\Lib\HTMLTestRunner_cn.py", line 941, in generateReport
report = self._generate_report(result)
File "D:\machine_Learning\Lib\HTMLTestRunner_cn.py", line 1011, in _generate_report
self._generate_report_test(rows, cid, tid, n, t, o, e)
File "D:\machine_Learning\Lib\HTMLTestRunner_cn.py", line 1028, in _generate_report_test
doc = t._testMethodDoc or ''
AttributeError: '_ErrorHolder' object has no attribute '_testMethodDoc'
请问,我故意给要测试的app添加的异常,然后就Pycharm控制台就输出这个bug,我不添加异常则能正常生成报告的HTML,添加了则不行请问是什么原因呢?
你好,能否增加一个功能,支持多线程执行测试用例并生成此测试报告
When I used HTMLTestRunner to generate test report, I encountered an error: ConnectionRefusedError:WinError[10061] because the target machine actively refused, unable to connect.
代码中使用print打印的信息,无法显示出来,再怎样更改可以打印到一个文本文件中
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.