How can I customize the report .xml output to contain info about JUnit suite's test classes?

How can I customize the report .xml output to contain info about JUnit suite’s test classes+methods, rather than methods only?

Right now, when I run a suite, the .xml output from Gradle shows only the suite class name. The test classes contained in the suite are not identified in the .xml output. See this example:

<testsuite name="webdriver.test.SuiteOne" tests="3" failures="0" errors="0" timestamp="2013-02-09T19:30:59" hostname="austenjt-PC" time="43.865">
  <testcase name="testHandleCacheOne" classname="webdriver.test.SuiteOne" time="14.759"/>
  <testcase name="testHandleCacheThree" classname="webdriver.test.SuiteOne" time="14.554"/>
  <testcase name="testHandleCacheThree" classname="webdriver.test.SuiteOne" time="14.551"/>

For example, if I wanted the .xml output file to look like this:

<testcase name="TestClass1.testHandleCacheOne" classname="webdriver.test.SuiteOne" time="14.759"/>

It’s a known limitation, and will be fixed at some point.

Ok, thanks. Is there a bug that I can watch so that I know when it is fixed?

I found a workaround for the time being although it is a bit of extra work. I can hard code the class name of each test into the parameters that are passed in the paramertized tests and the report will display the parameter of the classname.

@Parameters(name = "{0}: {1}: Classname is {2}")
1 Like