Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cucumber .feature file is not getting linked to stepDefinition.java in Eclipse

I have installed Natural 0.7.6 plug-in from eclipse marketplace and I have Windows 10. Eclipse version: Eclipse IDE for Java Developers Version: 2020-03 (4.15.0) Build id: 20200313-1211

Maven dependencies related to Cucumber:

    <dependency>
    <groupId>io.cucumber</groupId>
    <artifactId>cucumber-java</artifactId>
    <version>5.7.0</version>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>5.7.0</version>
        <scope>test</scope>
    </dependency>   
  </dependencies>

.feature file

step definition file

  [1]: [https://i.sstatic.net/e22x3.png][1]
  [2]: https://i.sstatic.net/cAfLY.png

The .feature file complains about "No definition found for ". CTRL+CLICK on .feature file step is not navigating to stepDefinition file (screenshots attached). Am I missing any plugin? Is there any compatibility issues with Eclipse IDE version and the Cucumber plug-in I am using? I appreciate your help guys.

like image 244
user3166602 Avatar asked Sep 01 '26 11:09

user3166602


2 Answers

Steps to make it work.

  1. Clear out all the cucumber related plugins(e.g. Natural 0.9, cucumber eclipse plugin 1.0.0.xxxxx). Please do follow the suggestion of restarting your eclipse.
  2. Go to Help --> Eclipse Market place --> Install 'cucumber-eclipse' plugin. Please do follow the suggestion of restarting your eclipse.
  3. Right click on your project --> Configure --> Convert to Cucumber project.
  4. Now try to navigate to your step definition by 'Ctrl+click' on test step in feature file

Edit: I also changed JRE system library to 1.8( I am not sure it has any influence to make cucumber work )

like image 144
Rajan Domala Avatar answered Sep 03 '26 05:09

Rajan Domala


With the Cucumber Eclipse plugin, cleaning the Cucumber project (Project > Clean...) made the Gherkin steps Ctrl+click-able again.

like image 42
egad Avatar answered Sep 03 '26 07:09

egad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!