2

我正在使用 athaydes 插件创建带有逐步屏幕截图的 HTML 报告。它工作正常并为所有步骤捕获屏幕截图。但是我的要求是,如何仅为失败的步骤捕获屏幕截图。那里是否有任何规定,或者我是否需要在 athaydes 属性文件中使用任何特定关键字。我正在使用下面的属性文件“ 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

谁能帮我解决这个问题。谢谢!

4

1 回答 1

4

这与 spock-reports 没有直接关系。当您使用 Geb 时,您可以通过以下设置将其配置为仅报告失败GebConfig.groovy

reportOnTestFailureOnly = true

有关详细信息,请参阅Geb官方文档。

于 2018-05-12T19:40:58.393 回答