Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testNG DataProvider: in case one data set fails the following data sets are not performed #123

Closed
mgehlen opened this issue Sep 20, 2015 · 1 comment
Assignees
Milestone

Comments

@mgehlen
Copy link

mgehlen commented Sep 20, 2015

Hello,

I have a problem using testNGs DataProviders, when one of the test sets is failing.
Here is my type of scenario:

@Test(groups = {"login"}, dataProvider = "loginTest")
    public void error_cases_login(String user, String password, String errorMessage) {

        given().user_$_with_password_$(user, password) ;

        when().he_tries_to_login();

        then().he_sees_error_message(errorMessage).
                and().he_did_not_login() ;
    }

    @DataProvider(name = "loginTest")
    public static Object[][] createLogins() {

        return new Object[][]{
                {"mgehlen", "12345678", "password too short (min. 8 characters"},
                {"mgehl3n", "12345678", "user unknown"},
        };
    }

The first test fails since the password is actually long enough, the test skips the "and he did not log in" step, which is completely fine.
But now the second test with the second data set ist also skipped. In my point of view a faulty data set should not lead to ending the whole test case. Or should it?

Thank you very much,

mgehlen

@janschaefer
Copy link
Contributor

No that should not happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants