Contents of .feature file isn't recognized in intelliJ

Viewed 12534

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?

5 Answers

So i use IntelliJ 2018

1) go to Preference enter image description here

2)in open tab search "File Types" and search for text

enter image description here

3) in Text inside "Registred Patterns" delete "*.feature"

4) then search Cucumber Scenario and add "*.feature" enter image description here

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.

First make sure you have cucumber for java installed, if it is installed follow the below stpes,

1) Create a new feature file, like <test.feature> , after file creation a dialog box pops up

2) Select cucumber scenario in form the list and click Ok, there you GO.

Essentially two things are required to get cucumber feature recognized as expected type.

  1. After adding cucumber-java dependency in pom.xml
  2. 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

Related