I wrote feature files in a project in IntelliJ according to the cucumber syntax. This files worked in another computer. I added the cucumber-java jar files and also installed the Gherkin and cucumber plugins, but still feature files aren't recognized as they should be. What could be the problem?
-
Did you turn on the plugin for Cucumber/Gherkin? – Tim Biegeleisen Jul 30 '17 at 07:05
-
yes they are both turned on. – D.Guy Jul 30 '17 at 07:09
-
When you right click a scenario do you have the option to run it? I'm wondering if perhaps your JUnit is not configured correctly. – Tim Biegeleisen Jul 30 '17 at 07:14
-
no, I don't have the option to run. what should I do? – D.Guy Jul 30 '17 at 07:44
-
1Do the files reside in the source roots? – CrazyCoder Jul 30 '17 at 11:27
-
I had exactly the same problem. Probably Jetbrains should reconsider recommended plugins for Cucumber! – Mateva Nov 06 '17 at 11:29
-
Found the answer [here](https://stackoverflow.com/questions/39131653/intellij-idea-not-recognizing-feature-files). Worked for me. > If you have Substeps IntelliJ Plugin enabled then that might be the issue. you will need to remove and restart. – Brana Dec 19 '18 at 09:04
5 Answers
So i use IntelliJ 2018
2)in open tab search "File Types" and search for text
3) in Text inside "Registred Patterns" delete "*.feature"

- 1,662
- 19
- 30
Steps I took to get .feature
files recognized. I know that you've probably done this already, but it might help checking the steps again. If all fails, you could try to reinstall the plugins.
- Created a new Java project
- Created a new file with the .feature extension. Because the plugins were not installed, got the message
"Plugins supporting *.feature files found."
with the option to install the plugins - I didn't use this option because the suggested plugins were not what I wanted (check below image):
- Instead, I've opened
Settings > Plugins > Browse Repositories
and searched forCucumber for Java
- When trying to install this plugin you will be required to accept the installation of Gherkin as well. Make sure that after accepting, both plugins are selected.
- Restart IntelliJ and you should see the feature files recognized:
Hope it helps!

- 2,733
- 1
- 14
- 16
After installing plugin if you till face problem as i did, my feature files are not getting recognized because of groovy
therefore I manually set
File>>Settings>>Editor>>File Types click "cucumber Scenario" and Click + to add .Feature in Recognize Patterns.

- 313
- 2
- 9
Essentially two things are required to get cucumber feature recognized as expected type.
- After adding cucumber-java dependency in pom.xml
- You have to add Cucumber plugin also from > Settings>Plugin>MarketPlace>Search for cucumber for Java and install it
This will also ask you to install Gherkin as a Dependency
Select Yes>> Restart ide
Now you have to change file type from settings >> to cucumber scenario.
Note: you wont be getting Cucumber scenario as recognized type until done above installation.
Select cucumber scenario and Add + wildcard for it as-*.feature

- 305
- 1
- 5
- 15