首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >空手道-无法使用空手道0.9.5生成黄瓜报告

空手道-无法使用空手道0.9.5生成黄瓜报告
EN

Stack Overflow用户
提问于 2020-05-23 21:49:57
回答 2查看 375关注 0票数 1

我有一个问题,在生成黄瓜报告与样本空手道框架,我已经做了。我遵循了给出的步骤(快速入门-在空手道文档中给出),然后添加了生成报告的代码,但仍然没有生成报告。

如果任何人想要查看结构https://github.com/techj-sam/sampleAPITest,这里是Git

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-05-24 00:55:13

您为并行跑步器使用了@Karate.Test,这是一个错误。请阅读文档:https://github.com/intuit/karate#junit-5-parallel-execution

票数 0
EN

Stack Overflow用户

发布于 2020-08-22 19:08:50

您可以使用以下代码:

代码语言:javascript
运行
复制
@Test
void testParallel() {
    Results results = Runner.path("classpath:api/HealthCheck/com").tags("~@ignore").parallel(5);
    generateReport(results.getReportDir());
    assertEquals(0, results.getFailCount(), results.getErrorMessages());
}

public static void generateReport(String karateOutputPath) {
    Collection<File> jsonFiles = FileUtils.listFiles(new File(karateOutputPath), new String[] { "json" }, true);
    List<String> jsonPaths = new ArrayList<String>(jsonFiles.size());
    //jsonFiles.forEach(file -> jsonPaths.add(file.getAbsolutePath()));
    for(File file : jsonFiles){
        jsonPaths.add(file.getAbsolutePath());
    }
    Configuration config = new Configuration(new File("target"), "REST API Automation - Karate");
    ReportBuilder reportBuilder = new ReportBuilder(jsonPaths, config);
    reportBuilder.generateReports();
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61973019

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档