Running single cucumber scenario from .feature file

Answered

When I try to run a single cucumber scenario from a .feature file in IntelliJ 2020,1 (latest EAP), the output says that the scenario and each of its steps are undefined.

The test works fine when I run build from the Gradle tool window (project uses Gradle Wrapper 6.2.2), so I assume that the Gradle build script sets up Cucumber, yet that setup isn't run by IntelliJ whenever a user runs a single scenario.

How can I fix this?

I have the Cucumber for Groovy, Cucumber for Kotlin & Cucumber for Java plugins enabled.

The implementation code is in Groovy.

Thanks.

3 comments
Comment actions Permalink

May you show the exact error? 

At first, please try to clear cache (File | Invalidate caches and restart) and reimport the project after removing the .idea folder in the project's root. 

0
Comment actions Permalink

I'll try to do that soon.

The groovy step definition code is in a different directory than the cucumber feature files.

Will that not work?

If the Cucumber Groovy plugin can be configured to look for the groovy step files in certain directories, please let me know how to configure it.

If it can't be so configured, I'll open a new YouTrack issue.  Would that be a Feature, Usability Problem, or Bug?  I assume Feature, but will defer to your preferred categorization.

Thanks.

0
Comment actions Permalink

> Will that not work?

No. It is better to move stepdef files to test sources.

> I'll open a new YouTrack issue.

A similar issue exists already. See https://youtrack.jetbrains.com/issue/IDEA-121562

0

Please sign in to leave a comment.