自动化脚本执行完成后,将自动化执行情况的数据汇总到testResult.html,在jenkins构建完成后邮件给相关人员
报告类似:
测试报告html文件如:
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <title>testResult</title> </head> <body> <style> BODY, TABLE, TD, TH, P { font-family:Verdana,Helvetica,sans serif; font-size:11px; color:black; } h1 { color:black; } h2 { color:black; } h3 { color:black; } TD.bg1 { color:white; background-color:#0000C0; font-size:120% } TD.bg2 { color:white; background-color:#4040FF; font-size:110% } TD.bg3 { color:white; background-color:#8080FF; } TD.test_passed { color:blue; } TD.test_failed { color:red; } TD.console { font-family:Courier New; } </style> <hr/> <table bordercolor='#a0c6e5' style='border-collapse:collapse;' border='1' > <tr><td>测试开始时间</td><td>用时</td><td>版本信息</td><td>测试机IP地址</td></tr> <tr><td>2019-09-17 23:04:43</td><td>02:41:42.302</td><td align='center'>bytecache-mts-1.22.0-5.19.b.1.1568732618.x86_64</td><td align='center'>10.8.61.32</td></tr> </table> <br/><hr/> <table bordercolor='#a0c6e5' style='border-collapse:collapse;' border='1' > <tr><td>触发方式</td><td>研发代码变更</td><td>脚本变更</td></tr> <tr><td>定时触发</td><td>否</td><td>否</td></tr> </table> <br/><hr/> <table bordercolor='#a0c6e5' width='70%' style='border-collapse:collapse;' border='1' > <tr><td>执行套件数</td><td>成功套件数</td><td>失败套件数</td><td>成功率</td></tr> <tr><td>19</td><td bgcolor="#00ff00">15</td><td bgcolor="#ff0000">4</td><td>78.95%</td></tr> </table> <table bordercolor='#a0c6e5' width='70%' style="border-collapse:collapse;" border='1' > <tr><td>执行用例数</td><td>成功用例数</td><td>失败用例数</td><td>成功率</td></tr> <tr><td>162</td><td bgcolor="#00ff00">146</td><td bgcolor="#ff0000">16</td><td>90.12%</td></tr> </table> <br/><hr/> <table bordercolor='#a0c6e5' width='50%' style='border-collapse:collapse;' border='1' > <tr><td colspan='2'>失败套件名称</td></tr> <tr><td width='5%'>1</td><td>mts_dns_special_domain</td></tr> <tr><td width='5%'>2</td><td>mts_monitor_mts1</td></tr> <tr><td width='5%'>3</td><td>mts_subscribe_mode</td></tr> <tr><td width='5%'>4</td><td>mts_zmq_monitor</td></tr> </table> <br/><hr/> 详细集成报告详情参见:<a href="http://test.cdn.wangsu.com/atp/anonymous/home.action/reportDisplay/automaticReport/detail?testLogId=ff8080816d39bbf2016d40553234015a">http://test.cdn.wangsu.com/atp/anonymous/home.action/reportDisplay/automaticReport/detail?testLogId=ff8080816d39bbf2016d40553234015a</a> <br/><hr/> <table border='0' width='100%'> <tbody> <tr> <td colspan='2' class='bg1' width='100%'> <b>研发代码变更记录:</b><td> </tr> <tr> <td colspan='2' width='100%'> No Changes </td> </tr> </tbody> </table> </body> </html>
每天努力一点,每天学习一点。
Keep Moving...