前言:由于reportng生成的测试报告里没有失败的用例截图,现在想自己修改reportng,加上截图等功能。这里详细的总结一遍实现过程
主要参考博客:
https://testerhome.com/topics/3594
http://tech.it168.com/a2013/0906/1530/000001530755_all.shtml
#一、IDEA导入reportng源码
1、下载reportng源码,地址:https://github.com/dwdyer/reportng
2、将源码zip包解压
3、在IDEA里点击file-new-Project from Existing Sources…
4、选择解压后的文件,然后一直下一步打开,打开后目录如下:
#二、修改代码
1、reportng.properties 增加报表Log Info和Screen Shot列(列名最好用英文,用中文会乱码,我还未解决)
在该文件最后加如下代码
log=Log Info
screenshot=Screen Shot
2、results.html.vm 修改结果的html,如下图:
代码如下:
#if ($failedTests.size() > 0)
<table class="resultsTable">
<tr><th colspan="6" class="header failed">$mess