mustapha ousikis
mustapha ousikis

Reputation: 1

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

Hope you are doing well. I have a quick question please if someone can help me. In my case i can publish the result of my test on Zephyr for JIRA cloud. But I have in the summary field of my testcases the name of the package like (com.testcases.classname.methodname). How can we do that in order to have some description in that field instead of the name of the package please?

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

<testcase name="Test case name" classname="my description or summury like : test of my software XXXX" time="xxxx"/>

Thank you so much for your help.

Upvotes: 0

Views: 1389

Answers (1)

Gerold Broser
Gerold Broser

Reputation: 14772

AFAICS from the doc of surefire:test and TestNG's annotations (though it has @Test.description but if this is not printed to result .xml) this is not going to work without self-written:

  • mapping of testcase.nameyour test case name
  • mapping of testcase.classnameyour description or summary
  • string replacement according to the mappings

You could develop a custom Maven plugin with test as its default phase for this. Another option is to use the the Exec Maven Plugin to perform string replacement with a tool like sed or awk.

Upvotes: 1

Related Questions