alexkrechik / VSCucumberAutoComplete

Cucumber (Gherkin) Full Support Extension for VSCode
https://marketplace.visualstudio.com/items?itemName=alexkrechik.cucumberautocomplete
MIT License
331 stars 82 forks source link

Duplicated declarations #371

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hi, I declared following steps:

this.When(/^I wait for success screen dismissed$/, function (next) { next; });

this.And(/^I wait for success screen dismissed$/, function (next) { next; });

this.Then(/^I wait for success screen dismissed$/, function (next) { next; });

But autocompletion and validation works only for one of them.

alexkrechik commented 3 years ago

Validation will work separately in case of "strict gherkin validation" option usage. But, anyway, this is a good point - to try to get proper gherkin word in the code if gherkin strict mode enabled.

ghost commented 3 years ago

Ok, but I don't understand why it seems like other two steps are overwritten by the first one with strict mode enabled and autocompletion and validation doesn't works for them

alexkrechik commented 3 years ago

Because many (or most) cucumber framework see no difference between this.When and this.Andand definitions and will take the first found. So, the default behavior of the extension is the same, but, some 'strict' gherkin options were added later.