1

I am working with Intellij IDea and Appium and i have also installed cucumber. But i am unable to navigate to the step definition from the feature file by holding Ctrl button and clicking on the step.. It says "Cannot find declaration to go to". I have the step definition defined already but still it doesn't navigate.. Can any one suggest me any solution for this? Any help is appreciated.

6 Answers 6

2

Install the "Cucumber for Java" plugin in IntelliJ IDEA. It will give you the support you are asking for.

Search for plugins called Cucumber and you will find one written by Jetbrains that you want.

Sign up to request clarification or add additional context in comments.

2 Comments

Hey thanks a lot @Thomas Sundberg that works for me.. :)
This must be the least useable answer ever. This error happens very frequently, also on projects where the Cucumber for Java plugin has been installed allways.
1

The Eclipse feature that you are describing is called "Open declaration" and according to the official Eclipse documentation, it will attempt to navigate to the exact definition of the selected element if the selected element is a reference or a declaration.

In this case, the feature file steps are not a declaration and not even a java file. That won't work.

2 Comments

ohh.. But i am using intellij idea community edition.. it is very difficult to manually search and find the declaration.. can you please suggest some other way to do this in Intellij idea?
Mentioning that it was IntelliJ IDEA you needed help with would have been a good idea in your original question.
1

Go File->Settings--> plugins Then you can manage cucumber plugin as shown below This should redirect you to step definition when you click your test.

enter image description here

Hope this helps

2 Comments

If this helps you can accept the answer or upvote the answer! Cheers
This helps but Thomas Sundberg already gave the answer and i marked it as correct already. So thanks a lot for taking the trouble to show it visually :)
1

Need to install Natural plugin which is available in eclipse market.

Then open your feature file, Just keep cursor on any step & click Fun+F3 key together, it will take you to steps definition file corresponding to the steps.

Note-> This works on Mac, i am not sure about other OS.

1 Comment

Works in windows too!
0

Use below plugins for navigation purpose.

Go to eclipse or any ide > install new s/w, provide this url > ok URL-> http://rlogiacco.github.com/Natural

Restart ide > open any feature file > press command key if you are using mac or press control in case of windows & focus on any line which is present in the feature file > click > it will take you to respective steps definition file & method.

Comments

0

Following 3 steps are quite handy while configuring any Cucumber project from new/existing in Eclipse:

  1. Install these 2 Plugins from Eclipse Marketplace - Cucumber Eclipse & Natural
  2. Right-click on project and select Configure -> Convert to Cucumber Project...
  3. Install pending Eclipse updates, if any.

This will solve the original problem of navigation to step definition file from feature file in Eclipse as well.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.