The steps look good so perhaps it is not finding / using the step definition file.

Maybe the part from the instructions about:

“Your feature files can be added to the end of the line:

$ java -cp "/Users/jreijn/.m2/repository/info/cukes/cucumber-core/1.2.5/cucumber-core-1.2.5.jar:/Users/jreijn/.m2/repository/info/cukes/gherkin/2.12.2/gherkin-2.12.2.jar:/Users/jreijn/.m2/repository/info/cukes/cucumber-java/1.2.5/cucumber-java-1.2.5.jar:/Users/jreijn/.m2/repository/info/cukes/cucumber-jvm-deps/1.0.5/cucumber-jvm-deps-1.0.5.jar" cucumber.api.cli.Main Developer/sources/github/cucumber-jvm-extentreport/src/test/resources/cucumber/feature_one.feature

This will probably result in the following message:

UUUUUU
3 Scenarios (3 undefined)
6 Steps (6 undefined)
0m0.000s
You can implement missing steps with the snippets below:
[snip]

This means it can’t find the step definitions, hooks, etc that correspond to your feature file.

Let’s add the glue code required for running the tests. In the below example I’ll use my maven projects target directory, which contains my step definitions in the test-classes directory. You can do that by adding the directory to your classpath, and with the argument –glue com.sitture.definitions, provide the Java package that contains step definition Java classes.

$ java -cp "/Users/jreijn/.m2/repository/info/cukes/cucumber-core/1.2.5/cucumber-core-1.2.5.jar:/Users/jreijn/.m2/repository/info/cukes/gherkin/2.12.2/gherkin-2.12.2.jar:/Users/jreijn/.m2/repository/info/cukes/cucumber-java/1.2.5/cucumber-java-1.2.5.jar:/Users/jreijn/.m2/repository/info/cukes/cucumber-jvm-deps/1.0.5/cucumber-jvm-deps-1.0.5.jar:/Users/jreijn/Developer/sources/github/cucumber-jvm-extentreport/target/test-classes/" cucumber.api.cli.Main --glue com.sitture.definitions Developer/sources/github/cucumber-jvm-extentreport/src/test/resources/cucumber/feature_one.feature

The other part that caught my eye was all steps throwing stuff but I don’t know java



Source link https://sqa.stackexchange.com/questions/31075/how-to--selenium-cucumber---through-command-

LEAVE A REPLY

Please enter your comment!
Please enter your name here