【问题标题】:Is it possible to see scenarios in feature files in the runner window while running parallel in karate?在空手道中并行运行时是否可以在运行器窗口中查看功能文件中的场景?
【发布时间】:2023-01-26 03:05:22
【问题描述】:

当我使用并行运行器运行测试时,我无法在功能文件中看到失败或成功的场景。我想在 IntelliJ Idea 的运行器窗口中看到这些场景。我正在为黄瓜报告使用并行运行器。

这是我的代码

 @Test
    public void testParallel() {
        List<String> features = Arrays.asList("classpath:features");
        Results results = Runner.path(features)
                .outputCucumberJson(true).tags("~@ignore")
                .karateEnv("deee")
                .parallel(1);
        generateReport(results.getReportDir());
        assertTrue(results.getErrorMessages(), results.getFailCount() == 0);
    }

    public static void generateReport(String karateOutputPath) {
        Collection<File> jsonFiles = FileUtils.listFiles(new File(karateOutputPath), new String[] {"json"}, true);
        List<String> jsonPaths = new ArrayList<>(jsonFiles.size());
        jsonFiles.forEach(file -> jsonPaths.add(file.getAbsolutePath()));
        Configuration config = new Configuration(new File("target"), "deee");
        ReportBuilder reportBuilder = new ReportBuilder(jsonPaths, config);
        reportBuilder.generateReports();
    }

【问题讨论】:

    标签: cucumber karate junit5


    【解决方案1】:

    并行运行器不与 IDE 视图集成。它专为 CI 执行而设计。

    这个其他答案可以解释差异和原因:https://stackoverflow.com/a/65578167/143475

    欢迎您贡献代码,使其按照您想要的方式工作。

    【讨论】:

      猜你喜欢
      • 2022-01-09
      • 2021-02-27
      • 1970-01-01
      • 2022-11-18
      • 1970-01-01
      • 2020-01-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多