【问题标题】:Generating single cucumber.json using Karate Framework使用空手道框架生成单个 cucumber.json
【发布时间】:2021-06-15 17:12:22
【问题描述】:

我在空手道测试中使用并行执行。我试图在 target 文件夹中生成一个 cucumber.json 文件。 使用当前设置,我在 surefire-reports 文件夹中有不同的 json 和 xml 文件。有没有办法可以生成带有特征结果的单个 json 文件?

@CucumberOptions( format={"json:target/cucumber.json"})
public class TestParallel {

    @Test
    public void testParallel() {
        String karateOutputPath = "target/surefire-reports";
        KarateStats stats = CucumberRunner.parallel(getClass(), 5, karateOutputPath);
        generateReport(karateOutputPath);
        assertTrue("there are scenario failures", stats.getFailCount() == 0);
    }

任何帮助或指针将不胜感激。提前致谢!

【问题讨论】:

    标签: karate


    【解决方案1】:

    没有。但你永远不需要。 All reporting solutions 能够处理多个 JSON 文件。

    您需要单个 JSON 是否有任何具体原因?

    【讨论】:

    • 是的,我们想用测试结果更新下游系统,并且使用单个 json 文件更容易处理。您想到的任何实用程序可以用来组合不同的 json 文件吗?
    • @Saurabh - 感谢您的更新。没有其他人要求这样做,因此您最好的选择是尝试自己制定解决方案。如果你真的被卡住了,你可以打开一个功能请求,或者更好的是 - 提供一个解决方案:P
    • @Saurabh - 你可能会从黄瓜报告项目的代码中得到一些想法,它聚合了 JSON:github.com/damianszczepanik/cucumber-reporting
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-19
    • 1970-01-01
    相关资源
    最近更新 更多