junit4 icon indicating copy to clipboard operation
junit4 copied to clipboard

Custom data for the result XML report

Open OndraZizka opened this issue 11 years ago • 4 comments

In certain scenarios, it would be very handy to be able to add custom data to the xml report. Examples:

  • Mapping the test to set of requirements
  • Adding paths of screenshots taken during the test
  • Metrics taken during the test

It could be either taken from static data - annotations, or through an API.

@Test @CustomReportData("foo=bar") fooStatic() { ... }

fooDynamic(){ this.setCustomReportData("name", "value") }

OndraZizka avatar May 03 '13 16:05 OndraZizka

The junit project does not contain code for generating XML reports. Are you using, perhaps, ant or maven to generate XML?

dsaff avatar May 03 '13 18:05 dsaff

I always thought it's JUnit since both Ant and Maven based projects produced the same XML reports. (In my case, it's Maven.) But still, the additional info would have to come from JUnit, wouldn't it? The XML reports have to be generated from some JUnit objects.

OndraZizka avatar May 04 '13 12:05 OndraZizka

Hi !

I know this issue is quitely old but, I have the same problem as OndraZizka.

I read lot of docs and I have understood that ANT/Maven generate the XML report by reading the JUnit Description, If I'm wrong please tell me and explain how it works.

My problem is that I need to add more information into my report like url, picture path, etc... and then publish it with JUnit plugin on jenkins. For the moment I'm unable to modify Description and, to add information to the report...

Is there a way to do it? (it might be in your plan)

7170 avatar Jun 11 '15 06:06 7170

@7170 take a look http://allure.qatools.ru

baev avatar Jun 11 '15 11:06 baev