加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Report_EN.html 11.00 KB
一键复制 编辑 原始数据 按行查看 历史
palcw@126.com 提交于 2017-05-31 13:25 . add python file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{ Test Report }</title>
<meta name="generator" content="HTMLTestRunner 0.8.2.1"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<style type="text/css" media="screen">
body { font-family: Microsoft YaHei,Tahoma,arial,helvetica,sans-serif;padding: 20px; font-size: 80%; }
table { font-size: 100%; }
/* -- heading ---------------------------------------------------------------------- */
.heading {
margin-top: 0ex;
margin-bottom: 1ex;
}
.heading .description {
margin-top: 4ex;
margin-bottom: 6ex;
}
/* -- report ------------------------------------------------------------------------ */
#total_row { font-weight: bold; }
.passCase { color: #5cb85c; }
.failCase { color: #d9534f; font-weight: bold; }
.errorCase { color: #f0ad4e; font-weight: bold; }
.hiddenRow { display: none; }
.testcase { margin-left: 2em; }
</style>
</head>
<body >
<script language="javascript" type="text/javascript">
output_list = Array();
/*level 调整增加只显示通过用例的分类 --Findyou
0:Summary //all hiddenRow
1:Failed //pt hiddenRow, ft none
2:Pass //pt none, ft hiddenRow
3:All //pt none, ft none
*/
function showCase(level) {
trs = document.getElementsByTagName("tr");
for (var i = 0; i < trs.length; i++) {
tr = trs[i];
id = tr.id;
if (id.substr(0,2) == 'ft') {
if (level == 2 || level == 0 ) {
tr.className = 'hiddenRow';
}
else {
tr.className = '';
}
}
if (id.substr(0,2) == 'pt') {
if (level < 2) {
tr.className = 'hiddenRow';
}
else {
tr.className = '';
}
}
}
//加入【详细】切换文字变化 --Findyou
detail_class=document.getElementsByClassName('detail');
//console.log(detail_class.length)
if (level == 3) {
for (var i = 0; i < detail_class.length; i++){
detail_class[i].innerHTML="outline"
}
}
else{
for (var i = 0; i < detail_class.length; i++){
detail_class[i].innerHTML="detail"
}
}
}
function showClassDetail(cid, count) {
var id_list = Array(count);
var toHide = 1;
for (var i = 0; i < count; i++) {
//ID修改 点 为 下划线 -Findyou
tid0 = 't' + cid.substr(1) + '_' + (i+1);
tid = 'f' + tid0;
tr = document.getElementById(tid);
if (!tr) {
tid = 'p' + tid0;
tr = document.getElementById(tid);
}
id_list[i] = tid;
if (tr.className) {
toHide = 0;
}
}
for (var i = 0; i < count; i++) {
tid = id_list[i];
//修改点击无法收起的BUG,加入【详细】切换文字变化 --Findyou
if (toHide) {
document.getElementById(tid).className = 'hiddenRow';
document.getElementById(cid).innerText = "detail"
}
else {
document.getElementById(tid).className = '';
document.getElementById(cid).innerText = "outline"
}
}
}
function html_escape(s) {
s = s.replace(/&/g,'&amp;');
s = s.replace(/</g,'&lt;');
s = s.replace(/>/g,'&gt;');
return s;
}
</script>
<div class='heading'>
<h1>{ Test Report }</h1>
<p class='attribute'><strong>Tester : </strong> Findyou</p>
<p class='attribute'><strong>Start Time : </strong> 2017-05-31 13:01:29</p>
<p class='attribute'><strong>Duration : </strong> 0:00:00.001000</p>
<p class='attribute'><strong>Status : </strong> ALL 11 Pass 6 Failure 5, Passing rate: 54.55%</p>
<p class='description'></p>
</div>
<p id='show_detail_line'>
<a class="btn btn-primary" href='javascript:showCase(0)'>Summary{ 54.55% }</a>
<a class="btn btn-danger" href='javascript:showCase(1)'>Failed{ 5 }</a>
<a class="btn btn-success" href='javascript:showCase(2)'>Passed{ 6 }</a>
<a class="btn btn-info" href='javascript:showCase(3)'>ALL{ 11 }</a>
</p>
<table id='result_table' class="table table-condensed table-bordered table-hover">
<colgroup>
<col align='left' />
<col align='right' />
<col align='right' />
<col align='right' />
<col align='right' />
<col align='right' />
</colgroup>
<tr id='header_row' class="text-center success" style="font-weight: bold;font-size: 14px;">
<td>Test Group/Test case</td>
<td>Count</td>
<td>Pass</td>
<td>Fail</td>
<td>Error</td>
<td>View</td>
</tr>
<tr class='failClass warning'>
<td>MyTestCase</td>
<td class="text-center">5</td>
<td class="text-center">2</td>
<td class="text-center">3</td>
<td class="text-center">0</td>
<td class="text-center"><a href="javascript:showClassDetail('c1',5)" class="detail" id='c1'>Detail</a></td>
</tr>
<tr id='pt1_1' class='hiddenRow'>
<td class='passCase'><div class='testcase'>testCase1</div></td>
<td colspan='5' align='center'><span class="label label-success success">pass</span></td>
</tr>
<tr id='ft1_2' class='none'>
<td class='failCase'><div class='testcase'>testCase2</div></td>
<td colspan='5' align='center'>
<!--默认收起错误信息 -Findyou
<button id='btn_ft1_2' type="button" class="btn btn-danger btn-xs collapsed" data-toggle="collapse" data-target='#div_ft1_2'>fail</button>
<div id='div_ft1_2' class="collapse"> -->
<!-- 默认展开错误信息 -Findyou -->
<button id='btn_ft1_2' type="button" class="btn btn-danger btn-xs" data-toggle="collapse" data-target='#div_ft1_2'>fail</button>
<div id='div_ft1_2' class="collapse in">
<pre>
ft1_2: Traceback (most recent call last):
File "test_HTMLTestRunnerEN.py", line 23, in testCase2
self.assertEqual(2,3,"testError")
AssertionError: testError
</pre>
</div>
</td>
</tr>
<tr id='ft1_3' class='none'>
<td class='failCase'><div class='testcase'>testCase3</div></td>
<td colspan='5' align='center'>
<!--默认收起错误信息 -Findyou
<button id='btn_ft1_3' type="button" class="btn btn-danger btn-xs collapsed" data-toggle="collapse" data-target='#div_ft1_3'>fail</button>
<div id='div_ft1_3' class="collapse"> -->
<!-- 默认展开错误信息 -Findyou -->
<button id='btn_ft1_3' type="button" class="btn btn-danger btn-xs" data-toggle="collapse" data-target='#div_ft1_3'>fail</button>
<div id='div_ft1_3' class="collapse in">
<pre>
ft1_3: Traceback (most recent call last):
File "test_HTMLTestRunnerEN.py", line 26, in testCase3
self.assertEqual(2,5,"测试错误")
AssertionError: 测试错误
</pre>
</div>
</td>
</tr>
<tr id='ft1_4' class='none'>
<td class='failCase'><div class='testcase'>testCase4</div></td>
<td colspan='5' align='center'>
<!--默认收起错误信息 -Findyou
<button id='btn_ft1_4' type="button" class="btn btn-danger btn-xs collapsed" data-toggle="collapse" data-target='#div_ft1_4'>fail</button>
<div id='div_ft1_4' class="collapse"> -->
<!-- 默认展开错误信息 -Findyou -->
<button id='btn_ft1_4' type="button" class="btn btn-danger btn-xs" data-toggle="collapse" data-target='#div_ft1_4'>fail</button>
<div id='div_ft1_4' class="collapse in">
<pre>
ft1_4: Traceback (most recent call last):
File "test_HTMLTestRunnerEN.py", line 29, in testCase4
self.assertEqual(2,1,"测试错误")
AssertionError: 测试错误
</pre>
</div>
</td>
</tr>
<tr id='pt1_5' class='hiddenRow'>
<td class='passCase'><div class='testcase'>testCase5</div></td>
<td colspan='5' align='center'><span class="label label-success success">pass</span></td>
</tr>
<tr class='failClass warning'>
<td>APITestCase</td>
<td class="text-center">6</td>
<td class="text-center">4</td>
<td class="text-center">2</td>
<td class="text-center">0</td>
<td class="text-center"><a href="javascript:showClassDetail('c2',6)" class="detail" id='c2'>Detail</a></td>
</tr>
<tr id='pt2_1' class='hiddenRow'>
<td class='passCase'><div class='testcase'>testCase1</div></td>
<td colspan='5' align='center'><span class="label label-success success">pass</span></td>
</tr>
<tr id='pt2_2' class='hiddenRow'>
<td class='passCase'><div class='testcase'>testCase2</div></td>
<td colspan='5' align='center'><span class="label label-success success">pass</span></td>
</tr>
<tr id='pt2_3' class='hiddenRow'>
<td class='passCase'><div class='testcase'>testCase3</div></td>
<td colspan='5' align='center'><span class="label label-success success">pass</span></td>
</tr>
<tr id='ft2_4' class='none'>
<td class='failCase'><div class='testcase'>testCase4</div></td>
<td colspan='5' align='center'>
<!--默认收起错误信息 -Findyou
<button id='btn_ft2_4' type="button" class="btn btn-danger btn-xs collapsed" data-toggle="collapse" data-target='#div_ft2_4'>fail</button>
<div id='div_ft2_4' class="collapse"> -->
<!-- 默认展开错误信息 -Findyou -->
<button id='btn_ft2_4' type="button" class="btn btn-danger btn-xs" data-toggle="collapse" data-target='#div_ft2_4'>fail</button>
<div id='div_ft2_4' class="collapse in">
<pre>
ft2_4: Traceback (most recent call last):
File "test_HTMLTestRunnerEN.py", line 51, in testCase4
self.assertEqual(2, 1, "测试错误")
AssertionError: 测试错误
</pre>
</div>
</td>
</tr>
<tr id='ft2_5' class='none'>
<td class='failCase'><div class='testcase'>testCase5</div></td>
<td colspan='5' align='center'>
<!--默认收起错误信息 -Findyou
<button id='btn_ft2_5' type="button" class="btn btn-danger btn-xs collapsed" data-toggle="collapse" data-target='#div_ft2_5'>fail</button>
<div id='div_ft2_5' class="collapse"> -->
<!-- 默认展开错误信息 -Findyou -->
<button id='btn_ft2_5' type="button" class="btn btn-danger btn-xs" data-toggle="collapse" data-target='#div_ft2_5'>fail</button>
<div id='div_ft2_5' class="collapse in">
<pre>
ft2_5: Traceback (most recent call last):
File "test_HTMLTestRunnerEN.py", line 54, in testCase5
self.assertEqual(2, 6, "testError")
AssertionError: testError
</pre>
</div>
</td>
</tr>
<tr id='pt2_6' class='hiddenRow'>
<td class='passCase'><div class='testcase'>testCase6</div></td>
<td colspan='5' align='center'><span class="label label-success success">pass</span></td>
</tr>
<tr id='total_row' class="text-center active">
<td>Total</td>
<td>11</td>
<td>6</td>
<td>5</td>
<td>0</td>
<td>Passing rate: 54.55%</td>
</tr>
</table>
<div id='ending'>&nbsp;</div>
<div style=" position:fixed;right:50px; bottom:30px; width:20px; height:20px;cursor:pointer">
<a href="#"><span class="glyphicon glyphicon-eject" style = "font-size:30px;" aria-hidden="true">
</span></a></div>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化