-
Notifications
You must be signed in to change notification settings - Fork 0
/
result.html
392 lines (340 loc) · 11 KB
/
result.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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
<?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>Demotesting result</title>
<meta name="generator" content="HTMLTestRunner 0.8.2"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css" media="screen">
body { font-family: verdana, arial, helvetica, sans-serif; font-size: 80%; }
table { font-size: 100%; }
pre { word-wrap:break-word;word-break:break-all;overflow:auto;}
/* -- heading ---------------------------------------------------------------------- */
h1 {
font-size: 16pt;
color: gray;
}
.heading {
margin-top: 0ex;
margin-bottom: 1ex;
}
.heading .attribute {
margin-top: 1ex;
margin-bottom: 0;
}
.heading .description {
margin-top: 4ex;
margin-bottom: 6ex;
}
/* -- css div popup ------------------------------------------------------------------------ */
a.popup_link {
}
a.popup_link:hover {
color: red;
}
.popup_window {
display: none;
position: relative;
left: 0px;
top: 0px;
/*border: solid #627173 1px; */
padding: 10px;
background-color: #E6E6D6;
font-family: "Lucida Console", "Courier New", Courier, monospace;
text-align: left;
font-size: 8pt;
width: 500px;
}
}
/* -- report ------------------------------------------------------------------------ */
#show_detail_line {
margin-top: 3ex;
margin-bottom: 1ex;
}
#result_table {
width: 100%;
table-layout: fixed;
border-collapse: collapse;
border: 1px solid #777;
}
.test-steps {
width: 30%
}
.test-cases {
width: 20%
}
#result_table
#header_row {
font-weight: bold;
color: white;
background-color: #777;
}
#result_table td {
border: 1px solid #777;
padding: 2px;
}
#total_row { font-weight: bold; }
.passClass { background-color: #6c6; }
.failClass { background-color: #c60; }
.errorClass { background-color: #c00; }
.passCase { color: #6c6; }
.failCase { color: #c60; font-weight: bold; }
.errorCase { color: #c00; font-weight: bold; }
.hiddenRow { display: none; }
.testcase { margin-left: 2em; }
/* -- ending ---------------------------------------------------------------------- */
#ending {
}
</style>
</head>
<body>
<script language="javascript" type="text/javascript"><!--
output_list = Array();
/* level - 0:Summary; 1:Failed; 2:All */
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 < 1) {
tr.className = 'hiddenRow';
}
else {
tr.className = '';
}
}
if (id.substr(0,2) == 'pt') {
if (level > 1) {
tr.className = '';
}
else {
tr.className = 'hiddenRow';
}
}
}
}
function showClassDetail(cid, count) {
var id_list = Array(count);
var toHide = 1;
for (var i = 0; i < count; i++) {
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];
if (toHide) {
document.getElementById('div_'+tid).style.display = 'none'
document.getElementById(tid).className = 'hiddenRow';
}
else {
document.getElementById(tid).className = '';
}
}
}
function showTestDetail(div_id){
var details_div = document.getElementById(div_id)
var displayState = details_div.style.display
// alert(displayState)
if (displayState != 'block' ) {
displayState = 'block'
details_div.style.display = 'block'
}
else {
details_div.style.display = 'none'
}
}
function html_escape(s) {
s = s.replace(/&/g,'&');
s = s.replace(/</g,'<');
s = s.replace(/>/g,'>');
return s;
}
/* obsoleted by detail in <div>
function showOutput(id, name) {
var w = window.open("", //url
name,
"resizable,scrollbars,status,width=800,height=450");
d = w.document;
d.write("<pre>");
d.write(html_escape(output_list[id]));
d.write("\n");
d.write("<a href='javascript:window.close()'>close</a>\n");
d.write("</pre>\n");
d.close();
}
*/
--></script>
<div class='heading'>
<h1>Demotesting result</h1>
<p class='attribute'><strong>Start Time:</strong> 2016-12-09 11:11:01</p>
<p class='attribute'><strong>Duration:</strong> 0:00:00.029044</p>
<p class='attribute'><strong>Status:</strong> Pass 1 Error 2</p>
<p class='description'></p>
</div>
<p id='show_detail_line'>Show
<a href='javascript:showCase(0)'>Summary</a>
<a href='javascript:showCase(1)'>Failed</a>
<a href='javascript:showCase(2)'>All</a>
</p>
<table id='result_table'>
<colgroup>
<col align='left' />
<col align='right' />
<col align='right' />
<col align='right' />
<col align='right' />
<col align='right' />
<col align='right' />
<col align='right' />
</colgroup>
<tr id='header_row'>
<td class='test-cases'>测试案例</td>
<td>Count</td>
<td>Pass</td>
<td>Fail</td>
<td>Error</td>
<td>View</td>
<td class='test-steps'>测试内容</td>
<td class='test-steps'>测试步骤</td>
</tr>
<tr class='errorClass'>
<td>test_htmlReport.ReportTest</td>
<td>2</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td><a href="javascript:showClassDetail('c1',2)">Detail</a></td>
<td></td>
<td><a href="javascript:showClassDetail('c1',2)">查看测试步骤</a></td>
</tr>
<tr id='ft1.1' class='none'>
<td class='errorCase'><div class='testcase'>test_report</div></td>
<td></td>
<td></td>
<td></td>
<td colspan='1' align='center'>
<!--css div popup start-->
<a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_ft1.1')" >
Error</a>
<div id='div_ft1.1' class="popup_window">
<div style='text-align: right; color:red;cursor:pointer'>
<a onfocus='this.blur();' onclick="document.getElementById('div_ft1.1').style.display = 'none' " >
[x]</a>
</div>
<pre>
ft1.1: setup
<pyQa.HTMLTestRunnerNB.OutputRedirector object at 0x0000026DEC511240> <DESC_BEGIN>TC001:这个case是生产报告<DESC_END>
<pyQa.HTMLTestRunnerNB.OutputRedirector object at 0x0000026DEC511240> <STEP_BEGIN>点击元素: //a['登陆']1<STEP_END>
<pyQa.HTMLTestRunnerNB.OutputRedirector object at 0x0000026DEC511240> <STEP_BEGIN>等待元素://a['登陆']1<STEP_END>
2016-12-09 11:11:01:meet error when generate report
tearDown
Traceback (most recent call last):
File "D:\projects\python\autoMationCore\pyQa\unit_test\test_htmlReport.py", line 16, in test_report
Log.log_error_info("meet error when generate report")
File "D:\projects\python\autoMationCore\pyQa\log\log.py", line 14, in log_error_info
raise Exception("Assert error:", info)
Exception: ('Assert error:', 'meet error when generate report')
</pre>
</div>
<!--css div popup end-->
</td>
<td></td>
<td>TC001:这个case是生产报告</td>
<td><span style='color:blue'>点击元素: //a['登陆']1</span><br/><span style='color:blue'>等待元素://a['登陆']1</span><br/></td>
</tr>
<tr id='pt1.2' class='hiddenRow'>
<td class='none'><div class='testcase'>test_report1</div></td>
<td></td>
<td></td>
<td></td>
<td colspan='1' align='center'>
<!--css div popup start-->
<a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_pt1.2')" >
Pass</a>
<div id='div_pt1.2' class="popup_window">
<div style='text-align: right; color:red;cursor:pointer'>
<a onfocus='this.blur();' onclick="document.getElementById('div_pt1.2').style.display = 'none' " >
[x]</a>
</div>
<pre>
pt1.2: setup
<pyQa.HTMLTestRunnerNB.OutputRedirector object at 0x0000026DEC511240> <DESC_BEGIN>TC002:/api/test/case/10001:8080/news<DESC_END>
<pyQa.HTMLTestRunnerNB.OutputRedirector object at 0x0000026DEC511240> <STEP_BEGIN>等待元素:(xpath: //div/html/div[1]/a[contains(text(),'点击上传')]//a['登陆'])<STEP_END>
tearDown
</pre>
</div>
<!--css div popup end-->
</td>
<td></td>
<td>TC002:/api/test/case/10001:8080/news</td>
<td><span style='color:blue'>等待元素:(xpath: //div/html/div[1]/a[contains(text(),'点击上传')]//a['登陆'])</span><br/></td>
</tr>
<tr class='errorClass'>
<td>test_htmlReport.ReportTest1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td><a href="javascript:showClassDetail('c2',1)">Detail</a></td>
<td></td>
<td><a href="javascript:showClassDetail('c2',1)">查看测试步骤</a></td>
</tr>
<tr id='ft2.1' class='none'>
<td class='errorCase'><div class='testcase'>test_report</div></td>
<td></td>
<td></td>
<td></td>
<td colspan='1' align='center'>
<!--css div popup start-->
<a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_ft2.1')" >
Error</a>
<div id='div_ft2.1' class="popup_window">
<div style='text-align: right; color:red;cursor:pointer'>
<a onfocus='this.blur();' onclick="document.getElementById('div_ft2.1').style.display = 'none' " >
[x]</a>
</div>
<pre>
ft2.1: setup
<pyQa.HTMLTestRunnerNB.OutputRedirector object at 0x0000026DEC511240> <DESC_BEGIN>TC002:这个case是生产报告<DESC_END>
<pyQa.HTMLTestRunnerNB.OutputRedirector object at 0x0000026DEC511240> <STEP_BEGIN>发送 https://baidu.com/1/news<STEP_END>
<pyQa.HTMLTestRunnerNB.OutputRedirector object at 0x0000026DEC511240> <STEP_BEGIN>发送 https://baidu.com/1/news<STEP_END>
2016-12-09 11:11:01:meet error when generate report
tearDown
Traceback (most recent call last):
File "D:\projects\python\autoMationCore\pyQa\unit_test\test_htmlReport.py", line 36, in test_report
Log.log_error_info("meet error when generate report")
File "D:\projects\python\autoMationCore\pyQa\log\log.py", line 14, in log_error_info
raise Exception("Assert error:", info)
Exception: ('Assert error:', 'meet error when generate report')
</pre>
</div>
<!--css div popup end-->
</td>
<td></td>
<td>TC002:这个case是生产报告</td>
<td><span style='color:blue'>发送 https://baidu.com/1/news</span><br/><span style='color:blue'>发送 https://baidu.com/1/news</span><br/></td>
</tr>
<tr id='total_row'>
<td>Total</td>
<td>3</td>
<td>1</td>
<td>0</td>
<td>2</td>
<td> </td>
<td></td>
<td></td>
</tr>
</table>
<div id='ending'> </div>
</body>
</html>