Step recognised but not highlighted/linking to Step Definition when Scenario Outline parameter is used
nextlevelbeard opened this issue · 3 comments
Given('I have a Dream', async () => {
// Expect things
})
Scenario Outline: User can jump to step definition with a parameter: <parameter>
Given I have a <param> # Does not highlight/link but is recognized/defined
Examples:
| param |
| Dream |
Also, in Scenario Outlines undefined steps are always recognized as defined when they aren't, no undefined warning is issued
Scenario Outline: User can recognize undefined steps in Scenario Outlines
Given I have a something that is undefined # Recognized as defined when it should not
Examples:
| param |
| Dream |
I have the same issue
Hi @nextlevelbeard and @clobraico-hf, thank you for raising this issue.
The root cause lies within the Cucumber Language Service: it disables diagnostics for undefined steps if the test is a scenario outline (has an examples table) - so rather than being "always recognized as defined" for scenario outlines, the validation is actually disabled. My reasoning as to why this is yet to be supported is due to the challenges in ensuring clear and reliable behaviour to classify steps referencing examples table values as 'undefined'. This is in comparison to steps without parameters, where we can pass the step text to a validation function in its raw format.
I have captured an issue proposing this as a feature request (cucumber/language-service#149). I would greatly appreciate if you could take a look and provide any feedback.
Closing this issue as a duplicate of #90. Thanks again for raising, please continue discussion on that issue 🙌