I am using gradle in combination with geb and spock to test a web application. Gradle creates great reports, and geb takes screenshots of test failures for me, but I am struggling with how to customize the gradle reports to include a link to the screenshots that geb takes.
One approach is to disable the geb reports and use ant to create junit reports, then customize the junit xslt files (see http://gradle.1045684.n5.nabble.com/Customizing-JUnit-reports-td2265269.html#a2266034). I tried to look for how to do a similar thing with the gradle reports because I think they are better and I’d prefer to use gradle, but am a bit too illiterate to get there.
Searching on this subject hasn’t yielded much at all in the way of how to make custom reports for test results. Does anyone have any suggestions?
I am as lost as you but a few things I do notice. You can configure reports in build.gradle, like so:
reports.junitXml.destination = "$buildDir/test-results/MyReport"
reports.html.destination = "$buildDir/test-results/MyReport"
What options are available for configuration via closure? I do not know.
One thing I do know is that if you output the report as .xml, you can use a XSLT transformation to display it any way you like right?
More docs at: http://gradle.org/docs/current/groovydoc/org/gradle/api/reporting/package-frame.html
Will have to experiment with it.
Here is another link for fun: http://www.w3schools.com/xsl/xsl_transformation.asp
It would probably make more sense to users if, when you configure reports to be .xml, that it includes a default style sheet for the output.
I was experimenting with the “maven-surefire-report-plugin” and I found that you can customize the style sheet by modifying the following file “surefire-reports/html/custom.css”
AFTER you run the Maven goal of “site surefire-report:report”.
You run the “mvn.bat site” goal first so that it puts the CSS files into place, then the “surefire-report:report” goal to generate the HTML files.
I am sure you could write a intermediate goal to make changes to the .css file before you run the “report” goal. For example, run “mvn.bat site fixCSS surefire-report:report” .
The reason I mention this, is that I am going to try to do something similar with Gradle. Not sure if its possible yet, but I am going to try.
Hello, I am trying to customize gradle test report to show cucumber test results and I’m interested on the results of your experiments. Are you succeeded in that?