"cannot find declaration to go to" popup for cucumber lambda step definition

Answered

Hi,

I cannot navigate from a lambda step definition to the scenario line in the feature file.

I can navigate from the scenario line to the lambda step definition unless the scenario has a parameter.

Other step definitions and scenario lines work fine.

I have IntelliJ ultimate 2018.2.6, cucumber 4.2.0, java 1.8.0_192

Any help is appreciated

0
4 comments

Hi. Could you please provide exact steps to reproduce a problem?

0
Avatar
Permanently deleted user

I created a maven project, added the following dependencies:

io.cucumber cucumber-java8 4.2.0

io.cucumber cucumber-junit 4.2.0

org.seleniumhq.selenium selenium-java 3.141.59

I changed the settings to support Java 8. I created a feature file and then a step definition class. I created my step definitions with the lambda functions and everything worked without an issue except the fact that the steps in the feature file are still highlighted as they are not created. One of the steps is not highlighted even though that has also a lambda function. The only difference between those methods is that the lines those are highlighted have parameters. When I hover the mouse, "undefined step reference: ... " message pops-up. When I press "Ctrl" to move to the step definition, it gives me the message "cannot find declaration to go to" as they are not created. This works fine with the line that has no parameters. Again when I run the tests, they work fine. It is just this highlight and finding the step definition issue which is actually very big deal for me because I don't want to live without this convenient feature. I hope you can help. Thanks.

0
Avatar
Permanently deleted user
Scenario Outline: Positive Login test on the main page
Given users are on the login page
When users enter <username> and <password>
Then they should see their <firstname> on the top right corner
Examples:
| username | password | firstname |
| johndoe | coolguy | John |
0

Hi.

We have a related ticket:

https://youtrack.jetbrains.com/issue/IDEA-203167

Could you please provide a demo project where the problem reproduce?

0

Please sign in to leave a comment.