@@ -236,9 +236,17 @@ def generate_report(opts):
236
236
test_stats = TestStats ()
237
237
result .visit (test_stats )
238
238
239
- total_suite = test_stats .total_suite
240
- passed_suite = test_stats .passed_suite
241
- failed_suite = test_stats .failed_suite
239
+ try :
240
+ test_stats_obj = test_stats .all
241
+ except :
242
+ test_stats_obj = test_stats
243
+ total_suite = test_stats_obj .total_suite
244
+ passed_suite = test_stats_obj .passed_suite
245
+ failed_suite = test_stats_obj .failed_suite
246
+ try :
247
+ skipped_suite = test_stats_obj .skipped_suite
248
+ except :
249
+ skipped_suite = 0
242
250
243
251
#suitepp = round(passed_suite * 100.0 / total_suite, 1)
244
252
#suitefp = round(failed_suite * 100.0 / total_suite, 1)
@@ -252,9 +260,17 @@ def generate_report(opts):
252
260
generator = "Rebot"
253
261
254
262
stats = result .statistics
255
- total = stats .total .all .total
256
- passed = stats .total .all .passed
257
- failed = stats .total .all .failed
263
+ try :
264
+ stats_obj = stats .total .all
265
+ except :
266
+ stats_obj = stats .total
267
+ total = stats_obj .total
268
+ passed = stats_obj .passed
269
+ failed = stats_obj .failed
270
+ try :
271
+ skipped = stats_obj .skipped
272
+ except :
273
+ skipped = 0
258
274
259
275
#testpp = round(passed * 100.0 / total, 1)
260
276
#testfp = round(failed * 100.0 / total, 1)
@@ -265,6 +281,10 @@ def generate_report(opts):
265
281
total_keywords = kw_stats .total_keywords
266
282
passed_keywords = kw_stats .passed_keywords
267
283
failed_keywords = kw_stats .failed_keywords
284
+ try :
285
+ skipped_keywords = kw_stats .skipped_keywords
286
+ except :
287
+ skipped_keywords = 0
268
288
269
289
# Handling ZeroDivisionError exception when no keywords are found
270
290
# if total_keywords > 0:
@@ -313,10 +333,12 @@ def generate_report(opts):
313
333
<tbody>
314
334
<tr style="height:70%;font-size:25px" align="center" valign="middle">
315
335
<td style="width: 33%; color:brown">__STOTAL__</td>
336
+ <td style="width: 33%; color:orange">__SSKIP__</td>
316
337
<td style="width: 33%; color:#fc6666">__SFAIL__</td>
317
338
</tr>
318
339
<tr style="height:30%" align="center" valign="top">
319
340
<td style="width: 33%"><span style="color: #999999;font-size:10px">Total</span></td>
341
+ <td style="width: 33%"><span style="color: #999999;font-size:10px">Skip</span></td>
320
342
<td style="width: 33%"><span style="color: #999999;font-size:10px">Fail</span></td>
321
343
</tr>
322
344
</tbody>
@@ -352,10 +374,12 @@ def generate_report(opts):
352
374
<tbody>
353
375
<tr style="height:70%;font-size:25px" align="center" valign="middle">
354
376
<td style="width: 33%; color:brown">__TTOTAL__</td>
377
+ <td style="width: 33%; color:orange">__TSKIP__</td>
355
378
<td style="width: 33%; color:#fc6666">__TFAIL__</td>
356
379
</tr>
357
380
<tr style="height:30%" align="center" valign="top">
358
381
<td style="width: 33%"><span style="color: #999999;font-size:10px">Total</span></td>
382
+ <td style="width: 33%"><span style="color: #999999;font-size:10px">Skip</span></td>
359
383
<td style="width: 33%"><span style="color: #999999;font-size:10px">Fail</span></td>
360
384
</tr>
361
385
</tbody>
@@ -391,10 +415,12 @@ def generate_report(opts):
391
415
<tbody>
392
416
<tr style="height:70%;font-size:25px" align="center" valign="middle">
393
417
<td style="width: 33%; color:brown">__KTOTAL__</td>
418
+ <td style="width: 33%; color:orange">__KSKIP__</td>
394
419
<td style="width: 33%; color:#fc6666">__KFAIL__</td>
395
420
</tr>
396
421
<tr style="height:30%" align="center" valign="top">
397
422
<td style="width: 33%"><span style="color: #999999;font-size:10px">Total</span></td>
423
+ <td style="width: 33%"><span style="color: #999999;font-size:10px">Skip</span></td>
398
424
<td style="width: 33%"><span style="color: #999999;font-size:10px">Fail</span></td>
399
425
</tr>
400
426
</tbody>
@@ -452,14 +478,14 @@ def generate_report(opts):
452
478
453
479
<script>
454
480
window.onload = function(){
455
- executeDataTable('#sm',5 );
481
+ executeDataTable('#sm',6 );
456
482
executeDataTable('#tm',3);
457
483
executeDataTable('#km',3);
458
- createPieChart(__SPASS__,__SFAIL__,'suiteChartID','Suite Status:');
459
- createBarGraph('#sm',0,5 ,10,'suiteBarID','Elapsed Time (s) ','Suite');
460
- createPieChart(__TPASS__,__TFAIL__,'testChartID','Tests Status:');
484
+ createPieChart(__SPASS__,__SFAIL__,__SSKIP__, 'suiteChartID','Suite Status:');
485
+ createBarGraph('#sm',0,6 ,10,'suiteBarID','Elapsed Time (s) ','Suite');
486
+ createPieChart(__TPASS__,__TFAIL__,__TSKIP__, 'testChartID','Tests Status:');
461
487
createBarGraph('#tm',1,3,10,'testsBarID','Elapsed Time (s) ','Test');
462
- createPieChart(__KPASS__,__KFAIL__,'keywordChartID','Keywords Status:');
488
+ createPieChart(__KPASS__,__KFAIL__,__KSKIP__, 'keywordChartID','Keywords Status:');
463
489
createBarGraph('#km',1,3,10,'keywordsBarID','Elapsed Time (s) ','Keyword');
464
490
};
465
491
</script>
@@ -479,12 +505,15 @@ def generate_report(opts):
479
505
dashboard_content = dashboard_content .replace ("__STOTAL__" , str (total_suite ))
480
506
dashboard_content = dashboard_content .replace ("__SPASS__" , str (passed_suite ))
481
507
dashboard_content = dashboard_content .replace ("__SFAIL__" , str (failed_suite ))
508
+ dashboard_content = dashboard_content .replace ("__SSKIP__" , str (skipped_suite ))
482
509
dashboard_content = dashboard_content .replace ("__TTOTAL__" , str (total ))
483
510
dashboard_content = dashboard_content .replace ("__TPASS__" , str (passed ))
484
511
dashboard_content = dashboard_content .replace ("__TFAIL__" , str (failed ))
512
+ dashboard_content = dashboard_content .replace ("__TSKIP__" , str (skipped ))
485
513
dashboard_content = dashboard_content .replace ("__KTOTAL__" , str (total_keywords ))
486
514
dashboard_content = dashboard_content .replace ("__KPASS__" , str (passed_keywords ))
487
515
dashboard_content = dashboard_content .replace ("__KFAIL__" , str (failed_keywords ))
516
+ dashboard_content = dashboard_content .replace ("__KSKIP__" , str (skipped_keywords ))
488
517
dashboard_content = dashboard_content .replace ("__KHIDE__" , str (hide_keyword ))
489
518
490
519
page_content_div .append (BeautifulSoup (dashboard_content , 'html.parser' ))
@@ -538,17 +567,17 @@ def generate_report(opts):
538
567
tr .insert (4 , th )
539
568
540
569
th = soup .new_tag ('th' )
541
- th .string = "Time (s) "
570
+ th .string = "Fail "
542
571
tr .insert (5 , th )
543
572
573
+ th = soup .new_tag ('th' )
574
+ th .string = "Time (s)"
575
+ tr .insert (6 , th )
576
+
544
577
suite_tbody = soup .new_tag ('tbody' )
545
578
table .insert (11 , suite_tbody )
546
579
547
- # GET SUITE METRICS
548
- if group :
549
- group .spawn (result .visit , SuiteResults (soup , suite_tbody , log_name , opts .fullsuitename ))
550
- else :
551
- result .visit (SuiteResults (soup , suite_tbody , log_name , opts .fullsuitename ))
580
+ result .visit (SuiteResults (soup , suite_tbody , log_name , opts .fullsuitename ))
552
581
553
582
test_icon_txt = """
554
583
<div class="row">
@@ -614,10 +643,7 @@ def generate_report(opts):
614
643
table .insert (11 , test_tbody )
615
644
616
645
# GET TEST METRICS
617
- if group :
618
- group .spawn (result .visit , TestResults (soup , test_tbody , log_name , opts .fullsuitename , opts .showtags ))
619
- else :
620
- result .visit (TestResults (soup , test_tbody , log_name , opts .fullsuitename , opts .showtags ))
646
+ result .visit (TestResults (soup , test_tbody , log_name , opts .fullsuitename , opts .showtags ))
621
647
622
648
test_icon_txt = """
623
649
<div class="row">
@@ -714,17 +740,17 @@ def generate_report(opts):
714
740
# END OF LOGS
715
741
script_text = """
716
742
<script>
717
- function createPieChart(passed_count,failed_count,ChartID,ChartName){
743
+ function createPieChart(passed_count, failed_count, skipped_count, ChartID, ChartName){
718
744
var status = [];
719
745
status.push(['Status', 'Percentage']);
720
- status.push(['PASS',parseInt(passed_count)],['FAIL',parseInt(failed_count)]);
746
+ status.push(['PASS',parseInt(passed_count)],['FAIL',parseInt(failed_count)],['SKIP',parseInt(skipped_count)] );
721
747
var data = google.visualization.arrayToDataTable(status);
722
748
723
749
var options = {
724
750
pieHole: 0.6,
725
751
legend: 'none',
726
752
chartArea: {width: "95%",height: "90%"},
727
- colors: ['#2ecc71', '#fc6666'],
753
+ colors: ['#2ecc71', '#fc6666', '#ffa500' ],
728
754
};
729
755
730
756
var chart = new google.visualization.PieChart(document.getElementById(ChartID));
@@ -824,6 +850,12 @@ def generate_report(opts):
824
850
retrieve: true,
825
851
"order": [[ Number(sortCol), "desc" ]],
826
852
dom: 'l<".margin" B>frtip',
853
+ "aoColumnDefs": [ {
854
+ "aTargets": [ -1 ],
855
+ "mRender": function ( data, type, full ) {
856
+ return $("<div/>").html(data).text();
857
+ }
858
+ } ],
827
859
buttons: [
828
860
{
829
861
extend: 'copyHtml5',
0 commit comments