groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pradeep <>
Subject groovy email template script help.
Date Tue, 22 Nov 2016 08:46:25 GMT

I have written a groovy template script to be integrated to the E-mail Extn
plugin in Jenkins for sending customised reports.

The idea is to to parse the jUNIT Test reports from Jenkins and add the test
results in a tabular format. The problem is the "Test Pass Count", "Test
Fail Count", "Test status" is not reflected in a table result. I tried to
add some of the JUNIT parse code and tried to add to the table but it gives
lot of syntax errors. Can anyone please help me in this regard?

In short  I need to have table with Test Name, Test Status,Pass, Fail, Total
values populated in the table.



  	Test Name 
  	Test Status

<% def junitResultList = it.JUnitTestResult
try {
 def cucumberTestResultAction =
} catch(e) {
        //cucumberTestResultAction not exist in this build
if (junitResultList.size() > 0) { %>

 <% junitResultList.each{
  junitResult -> %>
     <% junitResult.getChildren().each { packageResult -> %>
        <% packageResult.getFailedTests().each{ failed_test -> %>
<li>Failed: ${failed_test.getFullName()} </li>
        <% }
 } %>

} %>

View this message in context:
Sent from the Groovy Users mailing list archive at

View raw message