I am trying to figure out how to include the filename of a specific test in the JUnit XML results file, as it currently only displays the class name:
<testcase name="xxxTest should do Y." time="0.119" classname="Chrome_80_0_3987_(Mac_OS_X_10_12_6).xxxTest">
In the karma.conf.js
file, there is an option called classNameFormatter
that can be passed when configuring the report, but I'm unsure if it can be used to extract the file name?
// karma.conf.js
// default configuration
junitReporter: {
outputDir: '', // results saved as $outputDir/$browserName.xml
outputFile: undefined, // results saved as $outputDir/$browserName/$outputFile
suite: '', // suite becomes package name attribute in xml testsuite element
useBrowserName: true, // add browser name to report and classes names
nameFormatter: undefined, // function (browser, result) to customize name attribute in xml testcase element
classNameFormatter: undefined, // function (browser, result) to customize classname attribute in xml testcase element
properties: {}, // key value pair of properties added to <properties> section of report
xmlVersion: null // use '1' for SonarQube 6.2 XML format
}