【问题标题】:Cucumber Report giving empty response黄瓜报告给出空的响应
【发布时间】:2020-07-22 12:07:06
【问题描述】:

我正在尝试在 BDD 中使用 SpringBoot 应用程序生成黄瓜报告 我在我的 pom.xml 中使用 1.2.6 版本的 info.cukes 并包含 cucumber-junit、cucumber-java、cucumber-spring 依赖项 下面是黄瓜的测试配置

@RunWith(Cucumber.class)
@CucumberOptions(features = "classpath:src/test/resources/features",plugin = {"pretty","json:target/cucumber.json"},glue = "classpath:src/test/java/com")
public class ApplicationTests {
}

当我运行我的功能文件时,bdd 运行得非常好,所有测试都通过了,但是当我看到目标文件夹中生成的黄瓜 json 文件时,它是空的

【问题讨论】:

  • 也尝试使用 io.cucumber 版本 6.2.2,但 cucumber.json 文件仍然为空,尽管所有测试场景都通过了

标签: spring-boot cucumber bdd


【解决方案1】:

您使用的是相当旧的 Cucumber 版本。我的建议是使用 6.7.0 及以上版本。它有黄瓜报告服务。它生成的报告非常好,而且生成起来非常简单。

  1. 在pom.xml中添加6.7.0及以上版本的Cucumber-jvm。
  2. 在 src/test/resources 中创建 Cucumber.properties 文件并在文件中提及指令 -

cucumber.publish.enabled=true

你已经准备好了。尝试使用 mvn test 从命令行运行测试。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-17
    • 1970-01-01
    • 2019-08-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多