Search code examples
cucumberkaratejunit5

Is it possible to see scenarios in feature files in the runner window while running parallel in karate?


When I run my tests with a parallel runner, I can't see scenarios in the feature files in which one failed or successful. I want to see these scenarios on the runner window in IntelliJ Idea. I am using parallel runner for cucumber reports.

Here is my code

 @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();
    }

Parallel run

What I really want to see


Solution

  • The parallel runner does not integrate with the IDE view. It is designed for CI execution.

    This other answer may explain the difference and why: https://stackoverflow.com/a/65578167/143475