In order to integrate with an external test management solution and have visibility of karate results, I need to import them using the JUnit XML report. Test cases identified in JUnit's XML report are identified by the name and classname attributes on the element. However, it seems that these names are being generated somehow dynamicaly and not as unique identifiers that clearly identify the original testcase. The ideal case would be to have unique identifiers for the corresponding testcases, so if we import results multiple times they are always associated with the same entities in the test management solution.
I've tried running the karate-junit5 sample code and ran it using "mvn test". This is a sample of the generated JUnit XML report.
<testcase name="testTags[1][1]" classname="karate.SampleTest" time="0.002"/>
<testcase name="testSample[1][1]" classname="karate.SampleTest" time="0"/>
<testcase name="testSample[1][2]" classname="karate.SampleTest" time="0"/>
<testcase name="testFullPath[1][1]" classname="karate.SampleTest" time="0"/>
I'd expect that the "name" attribute would be filled with an unique identifier for the test case, independent on how many times it will be run, for example with the value of Scenario (e.g. "first hello world")
Feature: sample
Scenario: first hello world
* print 'hello'
Scenario: second scenario
* print 'second'
Thus, having a generate JUnit XML report like this would be something more useful.
<testcase name="second" classname="karate.SampleTest" time="0.002"/>
<testcase name="first hello world" classname="karate.SampleTest" time="0"/>
<testcase name="second scenario" classname="karate.SampleTest" time="0"/>
<testcase name=first" classname="karate.SampleTest" time="0"/>
Or having the name attribute being filled with the feature name plus the scenario name. Anyway, is there any way of configuring how these attributes on the element of the Junit report should be filled?