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

Sentences in Feature description starting with "In" and "And" flagged with warning saying they are not steps #339

Open osmolyar opened 4 years ago

osmolyar commented 4 years ago

Describe the bug Sentences in the Feature description section starting with "In" and "And" are flagged with warning saying they are not steps, e.g.

Feature: Login As a system administrator In order to test login access control to the management portal I want to log in with valid and invalid credentials with default authentication options And log out of the page

The 2nd and 4th line are flagged saying "Was unable to find step for". Actual steps that are defined are recognized fine.

Expected behavior Expect no warning on Feature description lines that are not part of any Scenario or Scenario outline. Expect "In" not to be treated as a step keyword.

Screenshots If applicable, add screenshots to help explain your problem. image

Cucumberautocomplete part of VSCode settings:

        "cucumberautocomplete.steps": [
            "./features/step_definitions/*.ts",
        ],
        "cucumberautocomplete.syncfeatures": "./features/*.feature",
        "cucumberautocomplete.strictGherkinCompletion": false,

or same thing with more complete settings, as

"cucumberautocomplete.steps": [
            "./features/step_definitions/*.ts",
        ],
        "cucumberautocomplete.syncfeatures": "./features/*.feature",
        "cucumberautocomplete.strictGherkinCompletion": false,
        "cucumberautocomplete.strictGherkinValidation": false,
        "cucumberautocomplete.smartSnippets": true,
        "cucumberautocomplete.stepsInvariants": true,
        "cucumberautocomplete.customParameters": [
            {
                "parameter":"{ab}",
                "value":"(a|b)"
            },
            {
                "parameter":/\{a.*\}/,
                "value":"a"
            },
        ],
        "cucumberautocomplete.skipDocStringsFormat": true,
        "cucumberautocomplete.formatConfOverride": {
            "And": 3,
            "But": "relative",
        },
        "cucumberautocomplete.onTypeFormat": true,

Step definition: If applicable, add example of step definition:


Given('I log in to the application', function () {
    this.nav.homePage=loginPage.logInToApplication(this.context.loginBusinessOptions);
    context.homePage=this.nav.homePage;
    context.loginBusinessOptions=this.context.loginBusinessOptions;
});
rotchajunior commented 4 years ago

Same issue here.

alexkrechik commented 4 years ago

Will be fixed with new feature file parser.

rioj7 commented 2 years ago

In and And are valid Gherkin keywords in some language.

If you use the lower case variant in and and it would solve it.

Or find a text line where these words are not the first word of the line.