Search code examples
cucumberbuild.gradlecucumber-java

How to run Cucumber scenario?


I can't run the Cucumber scenario from example.feature.

When I click on CucumberTestRunner.java everything is fine and the tests pass..

screenshot

But as soon as I click on the scenario, everything breaks

screenshot

Here are my dependencies in gradle

screenshot

Here are my scenario


Solution

  • When you click the run button in a scenario, instead of using the cucumber-junit-engine, IDEA uses the io.cucumber.core.cli to run your features.

    IDEA unfortunately tries to guess which packages might have step definitions. And sometimes it guesses incorrectly.

    You can change the run configuration and clear out the "Glue" field.

    https://youtrack.jetbrains.com/issue/IDEA-243074/Do-not-suggest-glue-packages-for-Cucumber-v6.0.0