bddkaratejunit5atdd

How to get JSON output with Karate & Junit5?


I am using com.intuit.karate.junit5.Karate and it is generating the HTML report only but I would like to have JSON output.

I looked at the code however it is by default generating the HTML output only by calling Engine.saveResultHtml() method.

May I know what options we can use to get the JSON output instead of HTML?


Solution

  • Use the parallel runner.

    The JUnit runners are only intended to be used in dev-mode and the HTML report is good for trouble-shooting tests.

    Otherwise all teams use the cucumber-html-report, especially in a CI build - which depends on the JSON output you are referring to: https://github.com/intuit/karate/tree/master/karate-demo#example-report