Giter Site home page Giter Site logo

goversky / htmltestrunner_cn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tungwaiyip/htmltestrunner

195.0 195.0 155.0 22.31 MB

HTMLTestRunner 汉化版,同时支持python 2和3,增加截图展示功能,失败重试

Python 100.00%
htmltestrunner python2 python3 retry screenshots unittest

htmltestrunner_cn's Issues

报告显示异常

新版本生成的测试报告,饼图不显示, 点击详情无法展开, 点击截图无法显示, 点击报告其它链接都没效果
用你项目的脚本执行生成的测试报告也是一样的问题
我用的是python3.7.1, 有关系?
image

另外, 代码中的'<>'会报错是不是要替换成'!='?
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

html报告统计总数有问题

非常感谢您分享的代码,感觉非常实用,发现一个小问题。生成的html报告,总数里面没有统计“跳过用例”,如:执行6个用例,1个错误,2个通过,3个跳过,"所有[3]"中只显示了3,照理说应该有6个,跳过的没统计上
image

“饼图”位置固定,信息重叠

1.描述信息过长时,饼图会遮挡描述信息
2.在使用多进程并发执行测试用例时,同一个页面差生了多个表头的测试报告,但是饼图信息重叠。
image
3.另外,想请教一下,有没有什么方法可以将图中的测试报告数据合并

AttributeError: '_ErrorHolder' object has no attribute '_testMethodDoc'

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,添加了则不行请问是什么原因呢?

Python3截图问题

说明文档中提到:

在python3 中因为unittest运行机制变动,在使用setUp/tearDown中初始化/退出driver时,会出现用例执行失败没有截图的问题,所以推荐使用样例中setUpClass/tearDownClass的用法

如果想在setUp/tearDown中初始化/退出driver可以截图,这个问题有什么办法解决吗?我使用setUpClass/tearDownClass的用法,当一个类里面有多个用例时,截到的图是不准确的,并不是在失败位置的截图。

bug AttributeError: 'NoneType' object has no attribute 'find'

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.