Skip to content

ParameterizedTests with a name attribute are not being properly handled #33

Description

@bitcoder

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"})
    public void parameterizedTestWithCustomName(String name)
    {
       // ...
    }

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"})
    public void parameterizedTestWithCustomNameAndDisplayName(String name)
    {
        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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions