【问题标题】:How to take screenshots only for failure step in geb using athaydes plugin如何使用 athaydes 插件仅针对 Geb 中的失败步骤截取屏幕截图
【发布时间】:2018-05-11 03:53:27
【问题描述】:

我正在使用 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

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

【问题讨论】:

  • 您可能想通过在他的 GitHub 存储库中创建 ticket 来询问作者。

标签: spock geb spock-reports


【解决方案1】:

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

reportOnTestFailureOnly = true

更多信息请见官方Geb documentation

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-28
    • 1970-01-01
    • 1970-01-01
    • 2018-09-04
    相关资源
    最近更新 更多