I have a feature file with the following:
Scenario: Test something
Given I do something to test something
My step definition:
import io.cucumber.java.en.Given;
...
@Given("I do something to test something")
public void doSomething()
{
....
}
From my pom.xml:
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-testng</artifactId>
<version>4.6.0</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>4.6.0</version>
</dependency>
With the above, I can run my code using my runner, but in the IDE (IntelliJ IDEA) the step in the feature file is complaining about an "Undefined step reference". When I CTRL-left-click the step, it does not take me to the method for the step.
If I change my import to:
import cucumber.api.java.en.Given;
Everything works as expected (i.e. the step is found), but then I get a warning about import cucumber.api.java.en.Given being deprecated (and the "Given" in my code has a line going through it).
How can I make my the feature file work so that when I CTRL-Left-Click on a step it will take me to the method for the step, but also avoid the "deprecated" warning?
import cucumber.api.java.en.Given;
), then everything works fine (except I get the "deprecated" warning and lines through deprecated annotations).