allure-framework / allure1

Allure 1 isn't supported any more, please consider using Allure 2 https://github.com/allure-framework/allure2 instead
Apache License 2.0
712 stars 169 forks source link

Parameter annotation throws NullPointerException if dataset = null #823

Closed irushah closed 7 years ago

irushah commented 8 years ago

Hi,

I have a negative test that takes in dataset with different values. Eg: null, empty string, invalid strings, etc. If i user @Parameter annotation provided by allure, it throws Null pointer Exception Here's the snippet of my test case and dataset

@Test(groups = TestGroups.Group1, dataProvider = "getInvalidCredentials")
    public void testInvalidLogin(@Parameter("username") String username,
            @Parameter("password") String password) {
        //do something with username and password
        }
    }
@DataProvider(name = "getInvalidCredentials")
    private Object[][] getInvalidCredentials() {
        return new Object[][] {
                                {null, null},
                                {"username", null}
               };
    }

Below is the stacktrace:

java.lang.NullPointerException at ru.yandex.qatools.allure.testng.AllureTestListener.fireAddParameterEvents(AllureTestListener.java:390)
    at ru.yandex.qatools.allure.testng.AllureTestListener.onTestStart(AllureTestListener.java:143)
    at org.testng.internal.Invoker.runTestListeners(Invoker.java:1700)
    at org.testng.internal.Invoker.runTestListeners(Invoker.java:1675)
baev commented 8 years ago

@irushah hi! Thanks for the report!