I was just tearing my hair out with exactly the same problem (for the record my background is Java, Ruby, Cucumber and RubyMine but I'm completely new to IntelliJ and Cucumber-JVM).
In the Cucumber-JVM run configuration
you must specify the package where the step definitions are stored in the glue
field as mentioned in the IntelliJ documentation. IntelliJ - for me at least - does not seem to provide a default value.
To elaborate further, a very basic project looks like this:
Example
└───src
├───main
│ └───java
└───test
├───java
│ └───com
│ └───bensnape
│ └───example
│ MyStepdefs.java
└───resources
example.feature
The glue
value here would be com.bensnape.example
.
Update
After playing with IntelliJ some more this morning, it seems that it does provide the glue
value for you if you adhere to the Cucumber-JVM conventions - i.e. the features must live under src/test/resources/<package>
and similarly, the steps must live under src/test/java/<package>
.
Example project tree:
Example
└───src
├───main
│ └───java
└───test
├───java
│ └───com
│ └───bensnape
│ └───example
│ MyStepdefs.java
│
└───resources
└───com
└───bensnape
└───example
example.feature