I downloaded the latest Cucumber Java version - 4.7.2, and am ale to run the cucumber test from IDE Intellij, everything is fine in IDE. However, if run from command line then it gives me error "io.cucumber.junit.UndefinedThrowable:"
Run test runner "RunCucumberTest" in IDE: OK
Cucumber-jvm Approach:
java -cp "lib/cucumber-4.7.2/*" io.cucumber.core.cli.Main --glue au.com.demo.quality.stepdefinitions --plugin pretty --name "^demo test$" src/test/resources/features/DemoTest.feature
result: step undefined as above
JUnit Approach:
java -cp "../lib/cucumber-4.7.2/*;../out/production/demo" org.junit.runner.JUnitCore au.com.demo.quality.runners.RunCucumberTest
result: step undefined as above
Project structure:
Quality
-lib
-out
--Production
---demo
......
-bdd
--src
---test
----java
----resources
More details as shown in the screenshot below.
I have searched in stackoverflow and google searched as well, no answer found. Useful refereces here but they are not my answer. Thanks.
https://github.com/cucumber/cucumber-jvm/issues/1127#issuecomment-303486249