Discussion:
[Cucumber] [JVM] Upgrade of cucumber to version 4 is causing issues
DA Bears
2018-10-25 16:34:17 UTC
Permalink
Older version: info.cukes:cucumber-java8:1.2.3-SNAPSHOT,
info.cukes:cucumber-spring:1.2.3-SNAPSHOT,
info.cukes:cucumber-junit:1.2.3-SNAPSHOT

New version: cucumber.io:cucumber-java8:4.1.0,
cucumber.io:cucumber-spring:4.1.0; cucumber.io:cucumber-junit:4.1.0

*Issue:*Cucumber fails to convert value from feature file to a double. This
used to work magically in earlier versions.

*Step Defs:*

@Then("^the price should be '(.*)'$")
public void validatePrice(double price) throws Throwable {
// code here
}

*Error from cucumber:*
cucumber.runtime.CucumberException: Failed to invoke <...>.validatePrice(
double) in file:<...>/target/test-classes/, caused by java.lang.
IllegalArgumentException: argument type mismatch
at cucumber.runtime.Utils$1.call(Utils.java:29)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:20)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java
:48)
at cucumber.runner.PickleStepDefinitionMatch.runStep(
PickleStepDefinitionMatch.java:50)
at cucumber.runner.TestStep.executeStep(TestStep.java:63)
at cucumber.runner.TestStep.run(TestStep.java:49)
at cucumber.runner.PickleStepTestStep.run(PickleStepTestStep.java:43)
at cucumber.runner.TestCase.run(TestCase.java:44)
at cucumber.runner.Runner.runPickle(Runner.java:40)
at cucumber.runtime.Runtime$1.run(Runtime.java:84)
at cucumber.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:
220)
at cucumber.runtime.Runtime.run(Runtime.java:81)
at cucumber.api.cli.Main.run(Main.java:26)
at cucumber.api.cli.Main.main(Main.java:8)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
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 cucumber.runtime.Utils$1.call(Utils.java:26)
... 14 more


*Question:* Is it too early to upgrade? Anyone has successes upgrading
existing project?

*Other Issue/Comment: *One other issue I came across was Cucumber did not
convert DataTable to POJO by default. I had to setup TypeRegistry to
default DataTableType for the POJOs. Workarounds for this issue
was https://stackoverflow.com/questions/50771856/cucumber-jvm-3-io-cucumber-datatable-undefineddatatabletypeexception
and https://github.com/cucumber/cucumber-jvm/issues/1426
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Search results for '[Cucumber] [JVM] Upgrade of cucumber to version 4 is causing issues' (Questions and Answers)
10
replies
About parakeets...?
started 2006-10-23 20:29:52 UTC
birds
Loading...