Search code examples
parallel-processingcucumberreportingkarate

Can I combine 2 cucumber reports generated by 2 Runners into a single one


I am trying to find a way to combine 2 test reports in one, so that I can run 2 levels of tests in the same call. As far as I can see it seems Features are always run in paralell and "parallel=false" only applies to scenarios and I want to run some in sequence and some in parallel. It would be something like this :

public void testParallel() {
    Results results1 = Runner.path("classpath:testone").tags("~@ignore").parallel(0);
    Results results2 = Runner.path("classpath:testtwo").tags("~@ignore").parallel(5);
    # Combine 2 results here
    Result = results1 + results2 (or concat, or whatever is correct)
    # then generate global report
    generateReport(results.getReportDir());
    assertEquals(0, results.getFailCount(), results.getErrorMessages());
  }

Any help appreciated
Thanks ;-)

Solution

  • 3 options:

    • refactor your tests to be in the same single Scenario (recommended)
    • refactor your tests to be in the same single Feature + @parallel=false tag
    • write a new Feature and do a call to the Scenario-s by tag, note that once you enter a call everything is on the same thread as the "caller"