2

Is it possible to add (log) custom information in HTML report for the passed test in Junit5 ?

I tried to use org.junit.jupiter.api.TestReporter from https://junit.org/junit5/docs/current/user-guide/#writing-tests-dependency-injection

but the published report entry is nowhere to be found. Generated HTML report has just information about name, duration and status of the test.

edit: any standard way of producing report is fine for me, as long as I would be able to insert some custom data. I tried generating report by gradle plugin and by ant task junitreport

Bartosz Bilicki
  • 12,599
  • 13
  • 71
  • 113

1 Answers1

0

If I remember correctly the console launcher https://junit.org/junit5/docs/current/user-guide/#running-tests-console-launcher with option ˋ—reports-dir=DIRˋ included report entries in the produced xml reports. Behaviour might have changed though, so you’ll have to try.

johanneslink
  • 4,877
  • 1
  • 20
  • 37
  • I am using ConsoleLauncher with —reports-dir option, but generated HTML does not have custom entries inserted by TestReporter. – Bartosz Bilicki Aug 02 '19 at 12:58