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

karate.abort() in Background-block throws NullPointerException #1019

Closed
beloyar777 opened this issue Jan 14, 2020 · 2 comments
Closed

karate.abort() in Background-block throws NullPointerException #1019

beloyar777 opened this issue Jan 14, 2020 · 2 comments

Comments

@beloyar777
Copy link

If you abort karate from a Background-block like this:

Feature: demonstrating abort in the background block    

Background:
* if (true) karate.abort()

Scenario: dummy scenario 1
* print, 'dummy scenario 1'

Scenario: dummy scenario 2
* print, 'dummy scenario 2'

it throws the following NullPointerException in maven output when you execute mvn clean test:

Running examples.ExamplesTest
13:00:40.059 [main] INFO  com.intuit.karate - karate.env system property was: null
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.664 sec <<< FAILURE!
examples.ExamplesTest  Time elapsed: 0.014 sec  <<< ERROR!
java.lang.NullPointerException
        at com.intuit.karate.core.Step.getDebugInfo(Step.java:46)
        at com.intuit.karate.core.ScenarioExecutionUnit.execute(ScenarioExecutionUnit.java:202)
        at com.intuit.karate.core.ScenarioExecutionUnit.run(ScenarioExecutionUnit.java:239)
        at com.intuit.karate.core.FeatureExecutionUnit.run(FeatureExecutionUnit.java:164)
        at com.intuit.karate.core.FeatureExecutionUnit.run(FeatureExecutionUnit.java:73)
        at com.intuit.karate.junit4.Karate.runChild(Karate.java:125)
...

See myproject.zip in attachments and execute mvn clean test to test it.

@beloyar777
Copy link
Author

It seems to be fixed in the master. Sorry, it can be closed.

@ptrthomas
Copy link
Member

yes see #970

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

No branches or pull requests

2 participants