2

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

Hakan Aras
  • 55
  • 5

1 Answers1

1

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

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • Thank you for your answer. For the user experience, it will be much more efficient to proceed with Junit5 and see the features and scenario details as a tree structure in the IDE. Otherwise, going under the target, selecting the report and opening it as HTML in the browser creates an extra burden. Because we have to repeat these stages over and over. I'll try to find a way to make it easier. – Hakan Aras Jan 26 '23 at 08:49
  • @HakanAras oh yes, contributions are welcome – Peter Thomas Jan 26 '23 at 13:51