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 does not fail when step is not not found #665

Closed
marceloverdijk opened this issue Feb 4, 2014 · 6 comments · Fixed by #719
Closed

Testng does not fail when step is not not found #665

marceloverdijk opened this issue Feb 4, 2014 · 6 comments · Fixed by #719

Comments

@marceloverdijk
Copy link

I'm having the following class to run the cukes tests:

@CucumberOptions(
    features = "src/test/resources/cucumber/the-test.feature",
    format = {"json:target/cucumber-report.json", "html:target/cucumber"},
    glue = "classpath:com.mycomp.cucumber.glue",
    strict = true,

public class RunCukesTest extends AbstractTestNGCucumberTests {
}

Note that strict is set to true.

When I run the this class using the testng Eclipse plugin it reports green.
But when I look at the generated reports I see it could not found the matcher and that other steps are skipped.

I've used a similar test case with JUnit and then the tests fails as expected.

Is this a bug with testng integration or am I missing something here?

@marceloverdijk
Copy link
Author

cc @martykube

@marceloverdijk
Copy link
Author

I've added the following at the end of TestNGCucumberRunner.runCukes():

if (runtime.exitStatus() != 0x0) {
        throw new CucumberException("Undefined step definition or pending feature found. Check log for more info.");
}

The exit status will contain error if there are actual errors or if in strict mode and there is undefined or pending class.

Maybe good to port this back to codebase?

@leonardoeloy
Copy link

+1

@aslakhellesoy
Copy link
Contributor

Can someone send a pull request please?

@brasmusson
Copy link
Contributor

Actually this problem is fixed as a small part of #653. This latest version of that PR is in this branch, where I fixed my own comments on it.
Anyway, I made a small, dedicated PR for this issue in #719.

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants