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

2
  • How do you produce the reports? The commandline runner, Gradle and Maven all do it differently. Commented Jul 30, 2019 at 20:23
  • @johanneslink I edited the question. Sofar I tried producing report by gradle and Ant. But I am fine with any way of producing report. Commented Aug 2, 2019 at 10:04

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I am using ConsoleLauncher with —reports-dir option, but generated HTML does not have custom entries inserted by TestReporter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.