allure-framework / allure-java

Allure integrations for Java test frameworks
Apache License 2.0
355 stars 225 forks source link

Missed parameterized (@DataProvider) TestNG tests when @Title specified #300

Closed VitMS closed 5 years ago

VitMS commented 6 years ago

[//]: # ( . Note: for support questions, please use Stackoverflow or Gitter. . This repository's issues are reserved for feature requests and bug reports. . . In case of any problems with Allure Jenkins plugin please use the following repository . to create an issue: https://github.com/jenkinsci/allure-plugin/issues . . Make sure you have a clear name for your issue. The name should start with a capital . letter and no dot is required in the end of the sentence. An example of good issue names: . . - The report is broken in IE11 . - Add an ability to disable default plugins . - Support emoji in test descriptions )

I'm submitting a ...

What is the current behavior?

If a test method have @Title annotation then a generated Allure report contains only test for the last item from a DataProvider.

@Features( "feature" )
@Stories( "story" )
public class MyTest {

    @DataProvider( name = "prepare_data" )
    public Object[][] dpPrepareData() {
        return new Object[][]{
                {"1", "Deleting", "Delete.sql"},
                {"2", "Adding 1", "1.sql"},
                {"3", "Adding 2", "2.sql"},
                {"4", "Adding 3", "3.sql"}
        };
    }

    @TestCaseId( "101" )
    @Test(
            groups = {"back-end", "smoke"},
            dataProvider = "prepare_data"
    )
    @Title( "Some test name" )
    public void prepare( String stepNo, String stepDescription, String sqlFile ) throws Exception {
        Step_N( stepNo, stepDescription, sqlFile );
    }

    @Step( "Step {0}. {1} ({2})" )
    private void Step_N( String step, String stepDescription, String sqlFile ) throws Exception {
       // Here is an impelementation code ...
    } 
}

A report with @Title: image

A report without @Title: image

What is the expected behavior?

Allure report should not skip tests.

Other information

[//]: # ( . e.g. detailed explanation, stacktraces, related issues, suggestions . how to fix, links for us to have more context, eg. Stackoverflow, Gitter etc )

baev commented 5 years ago

The issue fixed in Allure 2, please consider to upgrade since Allure 1 reached end of life