Closed paulprogrammer closed 7 years ago
thanks for reporting this. is an edge case for an error on the FIRST step in a file.
can you hard-code the url like * url 'http://foo.bar'
or add some dummy * print 'hello'
statement as the first line and see if that works around for now. so you tried the unofficial 0.5.0.3 version right ?
Same error on 0.5.0.3.
When I hardcode the url I get something about failing to construct the class by name: 'karate-http.properties'
java.lang.RuntimeException: failed to construct class by name: karate-http.properties not found, aborting
at com.intuit.karate.http.HttpClient.construct(HttpClient.java:266)
at com.intuit.karate.ScriptContext.<init>(ScriptContext.java:109)
at com.intuit.karate.StepDefs.<init>(StepDefs.java:82)
at com.intuit.karate.cucumber.KarateObjectFactory.getInstance(KarateObjectFactory.java:86)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:38)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
at com.intuit.karate.cucumber.CucumberUtils.runStep(CucumberUtils.java:133)
at com.intuit.karate.cucumber.KarateRuntime.runStep(KarateRuntime.java:51)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
at cucumber.runtime.model.CucumberScenario.runBackground(CucumberScenario.java:59)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:42)
at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:102)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
at com.intuit.karate.junit4.Karate.runChild(Karate.java:60)
at com.intuit.karate.junit4.Karate.runChild(Karate.java:25)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at com.intuit.karate.junit4.Karate.run(Karate.java:66)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
at ✽.* url 'http://httpbin.org'(apigee/feature/sanity/sanity.feature:7)
BTW, I just selected the most recent build on search.maven.org - might want to tag that as unofficial somehow ... or maybe not deploy it to central?
just refer to the doc. you need 2 dependencies. 0.5.0 is the latest official version. I would rather not deploy to central but from experience, many organizations are not able to use SNAPSHOT builds. so this is the compromise solution that we evolved.
documentation was not being followed closing as invalid.
Verified working with 0.5.0.3
Given a basic feature file and task runner (below) I'm getting an NPE in the
CucumberUtils.afterStep()
due to the KarateBackend returning a null forgetVars()
. AFAICT this is not a misconfiguration on my part, but rather a failure of the backend. Please advise.sanity.feature
SmokeTest.java
The Error