You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parameterized tests can be annotated with @ParameterizedTest; additionaly, it's possible to specify a custom name for each parameterized test.
@ParameterizedTest(name="#{index} - Test with Argument={0}")
@ValueSource(strings = {"John Doe", "Jimi Hendrix"})
publicvoidparameterizedTestWithCustomName(Stringname)
{
// ...
}
When the name is defined, it can even mention the DisplayName in case that annotation has also been used.
@DisplayName("custom DisplayName")
@ParameterizedTest(name="{displayName}: #{index} - Test with Argument={0}")
@ValueSource(strings = {"John Doe", "Jimi Hendrix"})
publicvoidparameterizedTestWithCustomNameAndDisplayName(Stringname)
{
fail("test failed on purpose");
}
The executed tests should produce different testcases with proper test_summary properties.
For the time being, the testcases will be identified by the same name, but each one will have a specific test_summary property using the name defined with the @ParameterizedTest annotation and its name attribute.
The text was updated successfully, but these errors were encountered:
Any plans for a release with this fix?
It would be much appreciated.
Not yet. This needs some additional thought and more testing.
You can try the code on the fix attempt and see how it works for you. Feedback and testing is highly appreciated
Parameterized tests can be annotated with
@ParameterizedTest
; additionaly, it's possible to specify a custom name for each parameterized test.When the
name
is defined, it can even mention the DisplayName in case that annotation has also been used.The executed tests should produce different testcases with proper
test_summary
properties.For the time being, the testcases will be identified by the same name, but each one will have a specific
test_summary
property using the name defined with the@ParameterizedTest
annotation and itsname
attribute.The text was updated successfully, but these errors were encountered: