Closed tome57a closed 4 years ago
I am taking a look into this now.
Oops, never mind.
The compiler is flagging the "@given" line with the error "Given cannot be resolved to a type".
It looks like you need to import your annotations, and/or correct the capitalization of your @Given
annotation.
I'll try to step in, maybe I can help solve this.
Importing org.agileware.natural.*
is of absolutely no use to you, you must refer to the classes defined in the Cucumber JVM project, thus importing io.cucumber.java.en.*
.
The same applies to the libraries you are referencing: Natural is an Eclipse plugin, not a BDD library, meaning you never import our library, you just use our plugin to help you out in using either Cucumber or JBehave.
In your case you want to either import cucumber-java or cucumber-java8: https://cucumber.io/docs/cucumber/step-definitions/.
Feel free to reopen if I misunderstood your question.
I am having a problem linking step definition methods to steps in my project. My environment is Eclipse Neon.3 on Windows 10 with the Natural 0.7.6 plugin installed. The code is as follows:
Feature file ProofOfConcept.feature:
The compiler is flagging the steps with 'no definition found' warnings.
Step definition file ProofOfConceptSteps.java:
The compiler is flagging the "@Given" line with the error "Given cannot be resolved to a type".
In the project, org.agileware.natural.*jar are added as Referenced Libraries. This project also uses Gradle to build but I have no idea what if anything to put into the build.gradle file to make this work. I tried adding the following line in the file's dependencies section but it doesn't help:
compile 'org.agileware.natural:0.7.6'
I've been unable to find sample code on the web to show the proper way to do this, and at this point I am stuck.
Thanks for any help!
Tom