How to take screenshots only for failure step in geb using athaydes plugin

828 Views Asked by At

I am using athaydes plugin to create HTML reports with step wise screen shots. It's working fine and capturing screenshots for all steps. However my requirement is that, how to capture screen shots only for failed steps. Is there any provision there or do I need to use any specific keyword in athaydes properties file. I am using below property file "com.athaydes.spockframework.report.IReportCreator.properties"

# Name of the implementation class of the report creator
com.athaydes.spockframework.report.IReportCreator=com.athaydes.spockframework.report.template.TemplateReportCreator

# Output directory (where the spock reports will be created) - relative to working directory
com.athaydes.spockframework.report.outputDir=target/reports

com.athaydes.spockframework.report.testSourceRoots=src/test/groovy

com.athaydes.spockframework.report.showCodeBlocks=false

# Set properties specific to the TemplateReportCreator
com.athaydes.spockframework.report.template.TemplateReportCreator.specTemplateFile=/templates/spec-template.html
com.athaydes.spockframework.report.template.TemplateReportCreator.reportFileExtension=html
com.athaydes.spockframework.report.template.TemplateReportCreator.summaryTemplateFile=/templates/summary-template.html
com.athaydes.spockframework.report.template.TemplateReportCreator.summaryFileName=index.html

Can anyone please help me on this. Thanks!

1

There are 1 best solutions below

0
On BEST ANSWER

This is not directly related to spock-reports. As you are using Geb, you can configure it to only report failures via the following setting in your GebConfig.groovy:

reportOnTestFailureOnly = true

See the official Geb documentation for more information.