How to get report on parameterized Junit tests while working through ANT?

I have a JUnit test that uses a parameterized runner. I have two parameters that need to be passed (country names). When this Junit runs in an HTML report for each parameter, it gives the result. But it gives a result with the name test1 [0], testname1 [1] ..... etc. For the parameter. (for each parameter it will add [] after the test name)

I want to tune the result, for example, 2 are the names of countries. I would like to have something like CountryName1 - under this testName1. Then CountryName2 .. testName.

Is there any way? Thanks in advance.

+4
source share
3 answers

There is already a problem for JUnit , which proposes to expand a parameterized runner to support better test names. Unfortunately, the problem has not yet been resolved.

An alternative is to use CallbackParams .

see also

Change test name of parameterized tests?

+2
source

With version 4.11 of JUnit, you can now rename parameterized tests. See this answer for a description of how to do this.

+1
source

I recently started a zohhak project. It allows you to write:

@TestWith({ "25 USD, 7", "38 GBP, 2", "null, 0" }) public void testMethod(Money money, int anotherParameter) { ... } 

and each call is communicated with parameters - check the screenshot on the main page

0
source

Source: https://habr.com/ru/post/1388428/


All Articles