Bartosz Bilicki
Bartosz Bilicki

Reputation: 13255

how to add custom info to junit5 HTML test report?

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

Upvotes: 2

Views: 2178

Answers (1)

johanneslink
johanneslink

Reputation: 5351

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.

Upvotes: 0

Related Questions