spock - 如何使用 athaydes 插件仅对 geb 中的失败步骤进行屏幕截图

标签 spock geb spock-reports

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

任何人都可以帮我解决这个问题吗?谢谢!

最佳答案

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

reportOnTestFailureOnly = true

查看官方Geb documentation了解更多信息。

关于spock - 如何使用 athaydes 插件仅对 geb 中的失败步骤进行屏幕截图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50284739/

相关文章:

automation - 将 Restful /修昔底德与史波克相结合

testing - Spock 和 Spock 报告 : how "catch" and customize the error message for AssertionError?

maven - 在 Spock 测试中无法启动 chromedriver

grails - 使用Geb维护测试之间的 session

groovy - fork 的groovyc返回错误代码:-1073741819

grails - 如何在 grails 中运行一部分 spock 功能测试?

java - 使用 Spock 在 Java 中 stub 或模拟静态方法

以下结构的 CSS 选择器帮助

grails - 无法在服务器上运行功能测试。 [geb 斯波克]