forked from findyou/HTMLTestRunnerCN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Report_CN.html
339 lines (289 loc) · 11 KB
/
Report_CN.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<?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>自动化测试报告</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="收起"
}
}
else{
for (var i = 0; i < detail_class.length; i++){
detail_class[i].innerHTML="详细"
}
}
}
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 = "详细"
}
else {
document.getElementById(tid).className = '';
document.getElementById(cid).innerText = "收起"
}
}
}
function html_escape(s) {
s = s.replace(/&/g,'&');
s = s.replace(/</g,'<');
s = s.replace(/>/g,'>');
return s;
}
</script>
<div class='heading'>
<h1>自动化测试报告</h1>
<p class='attribute'><strong>测试人员 : </strong> Findyou</p>
<p class='attribute'><strong>开始时间 : </strong> 2017-05-31 12:00:55</p>
<p class='attribute'><strong>合计耗时 : </strong> 0:00:00.001000</p>
<p class='attribute'><strong>测试结果 : </strong> 共 11,通过 6,失败 5,通过率= 54.55%</p>
<p class='description'></p>
</div>
<p id='show_detail_line'>
<a class="btn btn-primary" href='javascript:showCase(0)'>概要{ 54.55% }</a>
<a class="btn btn-danger" href='javascript:showCase(1)'>失败{ 5 }</a>
<a class="btn btn-success" href='javascript:showCase(2)'>通过{ 6 }</a>
<a class="btn btn-info" href='javascript:showCase(3)'>所有{ 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>用例集/测试用例</td>
<td>总计</td>
<td>通过</td>
<td>失败</td>
<td>错误</td>
<td>详细</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'>详细</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">通过</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'>失败</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'>失败</button>
<div id='div_ft1_2' class="collapse in">
<pre>
ft1_2: Traceback (most recent call last):
File "test_html.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'>失败</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'>失败</button>
<div id='div_ft1_3' class="collapse in">
<pre>
ft1_3: Traceback (most recent call last):
File "test_html.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'>失败</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'>失败</button>
<div id='div_ft1_4' class="collapse in">
<pre>
ft1_4: Traceback (most recent call last):
File "test_html.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">通过</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'>详细</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">通过</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">通过</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">通过</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'>失败</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'>失败</button>
<div id='div_ft2_4' class="collapse in">
<pre>
ft2_4: Traceback (most recent call last):
File "test_html.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'>失败</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'>失败</button>
<div id='div_ft2_5' class="collapse in">
<pre>
ft2_5: Traceback (most recent call last):
File "test_html.py", line 54, in testCase5
self.assertEqual(2, 9, "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">通过</span></td>
</tr>
<tr id='total_row' class="text-center active">
<td>总计</td>
<td>11</td>
<td>6</td>
<td>5</td>
<td>0</td>
<td>通过率:54.55%</td>
</tr>
</table>
<div id='ending'> </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>