1

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?

ernitingoel
  • 621
  • 2
  • 9
  • 24

1 Answers1

2

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

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • Thanks, it worked when I am running it as a Junit test from IDE however it's not been picked up my maven test, do I need to do anything to enable it? – ernitingoel Jan 31 '19 at 20:21
  • 1
    @ernitingoel maybe. read the docs please, tests for maven should end with `Test` or you can specify the test in the `maven-surefire-plugin` – Peter Thomas Feb 01 '19 at 00:26
  • 1
    Thanks, it was my bad, somehow it imported org.junit.Test instead of org.junit.jupiter.api.Test – ernitingoel Feb 01 '19 at 23:32