【问题标题】:How to create multiple json files from multiple cucumber tests如何从多个黄瓜测试中创建多个 json 文件
【发布时间】:2023-03-08 17:06:01
【问题描述】:

下面的黄瓜运行器类生成一个 JSON 文件。然后使用此 JSON 生成黄瓜报告。

我已经在我的资源中添加了一个新的 .feature 文件。

功能文件中的两组测试都通过了,但问题是没有生成第二个 JSON 文件,所以没有记录我的第二组结果。

@RunWith(Cucumber.class)
@CucumberOptions(
    plugin = {"progress",
            "html:build/report/cucumber/html",
            "junit:build/report/cucumber/junit/cucumber.xml",
            "json:build/report/cucumber/json/cucumber.json"
    },
    glue = {"com.commercial.tests"},
            features = {"src/test/resources/templates"},
            tags = {"@BR000, @BR002a, @BR002b, @BR003, @BR004, @BR004b, @BR005, @BR006, @BR007, @BR008", "not @wip"}
    )
public class QARunner {

public static void main(String[] args) {
    // TODO Auto-generated method stub
    System.exit(0);
}

}

上面,我指定创建cucumber.json,但是如何为第二个.feature指定第二个json文件呢?

【问题讨论】:

    标签: spring-boot cucumber


    【解决方案1】:

    问题已解决:上述代码有效,1 个 json 文件创建 2 个结果(每个特征文件 1 个)。

    因此无需在类顶部的注解中添加第二个 JSON 文件。

    【讨论】:

      猜你喜欢
      • 2016-12-23
      • 1970-01-01
      • 2013-10-17
      • 2019-03-19
      • 2018-06-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-23
      • 1970-01-01
      相关资源
      最近更新 更多