@@ -236,9 +236,17 @@ def generate_report(opts):
236236 test_stats = TestStats ()
237237 result .visit (test_stats )
238238
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
242250
243251 #suitepp = round(passed_suite * 100.0 / total_suite, 1)
244252 #suitefp = round(failed_suite * 100.0 / total_suite, 1)
@@ -252,9 +260,17 @@ def generate_report(opts):
252260 generator = "Rebot"
253261
254262 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
258274
259275 #testpp = round(passed * 100.0 / total, 1)
260276 #testfp = round(failed * 100.0 / total, 1)
@@ -265,6 +281,10 @@ def generate_report(opts):
265281 total_keywords = kw_stats .total_keywords
266282 passed_keywords = kw_stats .passed_keywords
267283 failed_keywords = kw_stats .failed_keywords
284+ try :
285+ skipped_keywords = kw_stats .skipped_keywords
286+ except :
287+ skipped_keywords = 0
268288
269289 # Handling ZeroDivisionError exception when no keywords are found
270290 # if total_keywords > 0:
@@ -313,10 +333,12 @@ def generate_report(opts):
313333 <tbody>
314334 <tr style="height:70%;font-size:25px" align="center" valign="middle">
315335 <td style="width: 33%; color:brown">__STOTAL__</td>
336+ <td style="width: 33%; color:orange">__SSKIP__</td>
316337 <td style="width: 33%; color:#fc6666">__SFAIL__</td>
317338 </tr>
318339 <tr style="height:30%" align="center" valign="top">
319340 <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>
320342 <td style="width: 33%"><span style="color: #999999;font-size:10px">Fail</span></td>
321343 </tr>
322344 </tbody>
@@ -352,10 +374,12 @@ def generate_report(opts):
352374 <tbody>
353375 <tr style="height:70%;font-size:25px" align="center" valign="middle">
354376 <td style="width: 33%; color:brown">__TTOTAL__</td>
377+ <td style="width: 33%; color:orange">__TSKIP__</td>
355378 <td style="width: 33%; color:#fc6666">__TFAIL__</td>
356379 </tr>
357380 <tr style="height:30%" align="center" valign="top">
358381 <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>
359383 <td style="width: 33%"><span style="color: #999999;font-size:10px">Fail</span></td>
360384 </tr>
361385 </tbody>
@@ -391,10 +415,12 @@ def generate_report(opts):
391415 <tbody>
392416 <tr style="height:70%;font-size:25px" align="center" valign="middle">
393417 <td style="width: 33%; color:brown">__KTOTAL__</td>
418+ <td style="width: 33%; color:orange">__KSKIP__</td>
394419 <td style="width: 33%; color:#fc6666">__KFAIL__</td>
395420 </tr>
396421 <tr style="height:30%" align="center" valign="top">
397422 <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>
398424 <td style="width: 33%"><span style="color: #999999;font-size:10px">Fail</span></td>
399425 </tr>
400426 </tbody>
@@ -452,14 +478,14 @@ def generate_report(opts):
452478
453479 <script>
454480 window.onload = function(){
455- executeDataTable('#sm',5 );
481+ executeDataTable('#sm',6 );
456482 executeDataTable('#tm',3);
457483 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:');
461487 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:');
463489 createBarGraph('#km',1,3,10,'keywordsBarID','Elapsed Time (s) ','Keyword');
464490 };
465491 </script>
@@ -479,12 +505,15 @@ def generate_report(opts):
479505 dashboard_content = dashboard_content .replace ("__STOTAL__" , str (total_suite ))
480506 dashboard_content = dashboard_content .replace ("__SPASS__" , str (passed_suite ))
481507 dashboard_content = dashboard_content .replace ("__SFAIL__" , str (failed_suite ))
508+ dashboard_content = dashboard_content .replace ("__SSKIP__" , str (skipped_suite ))
482509 dashboard_content = dashboard_content .replace ("__TTOTAL__" , str (total ))
483510 dashboard_content = dashboard_content .replace ("__TPASS__" , str (passed ))
484511 dashboard_content = dashboard_content .replace ("__TFAIL__" , str (failed ))
512+ dashboard_content = dashboard_content .replace ("__TSKIP__" , str (skipped ))
485513 dashboard_content = dashboard_content .replace ("__KTOTAL__" , str (total_keywords ))
486514 dashboard_content = dashboard_content .replace ("__KPASS__" , str (passed_keywords ))
487515 dashboard_content = dashboard_content .replace ("__KFAIL__" , str (failed_keywords ))
516+ dashboard_content = dashboard_content .replace ("__KSKIP__" , str (skipped_keywords ))
488517 dashboard_content = dashboard_content .replace ("__KHIDE__" , str (hide_keyword ))
489518
490519 page_content_div .append (BeautifulSoup (dashboard_content , 'html.parser' ))
@@ -538,17 +567,17 @@ def generate_report(opts):
538567 tr .insert (4 , th )
539568
540569 th = soup .new_tag ('th' )
541- th .string = "Time (s) "
570+ th .string = "Fail "
542571 tr .insert (5 , th )
543572
573+ th = soup .new_tag ('th' )
574+ th .string = "Time (s)"
575+ tr .insert (6 , th )
576+
544577 suite_tbody = soup .new_tag ('tbody' )
545578 table .insert (11 , suite_tbody )
546579
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 ))
552581
553582 test_icon_txt = """
554583 <div class="row">
@@ -614,10 +643,7 @@ def generate_report(opts):
614643 table .insert (11 , test_tbody )
615644
616645 # 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 ))
621647
622648 test_icon_txt = """
623649 <div class="row">
@@ -714,17 +740,17 @@ def generate_report(opts):
714740 # END OF LOGS
715741 script_text = """
716742 <script>
717- function createPieChart(passed_count,failed_count,ChartID,ChartName){
743+ function createPieChart(passed_count, failed_count, skipped_count, ChartID, ChartName){
718744 var status = [];
719745 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)] );
721747 var data = google.visualization.arrayToDataTable(status);
722748
723749 var options = {
724750 pieHole: 0.6,
725751 legend: 'none',
726752 chartArea: {width: "95%",height: "90%"},
727- colors: ['#2ecc71', '#fc6666'],
753+ colors: ['#2ecc71', '#fc6666', '#ffa500' ],
728754 };
729755
730756 var chart = new google.visualization.PieChart(document.getElementById(ChartID));
@@ -824,6 +850,12 @@ def generate_report(opts):
824850 retrieve: true,
825851 "order": [[ Number(sortCol), "desc" ]],
826852 dom: 'l<".margin" B>frtip',
853+ "aoColumnDefs": [ {
854+ "aTargets": [ -1 ],
855+ "mRender": function ( data, type, full ) {
856+ return $("<div/>").html(data).text();
857+ }
858+ } ],
827859 buttons: [
828860 {
829861 extend: 'copyHtml5',
0 commit comments