Search code examples
visual-studio-codecucumbercypress

Cucumber reference support in VSCode


In VsCode I am using Cypress with Cucumber preprocessor.

I have installed Cucumber (Gherkin) Full Support v2.15.2 plugin. The problem is, the lines from feature files are not recognized - not referencing to the code itself.

My feature files are placed under:

app/cypress/e2e/features/**/*.feature

and step definitions are in:

app/cypress/support/step_definitions/**/*.js"

I also tried to edit the settings.js (placed under C:/Users AppData) for cucumber:

{
    "cucumberautocomplete.steps": [
        "support/step_definitions/**/*.js"
    ],
    "cucumberautocomplete.syncfeatures": "e2e/features/**/*.feature"
}

also tried with full path, e.g. app/cypress/support... but still not working. All lines in feature files are underlined with warning - Unable to find step for "And do something..."


Solution

  • ok, for anyone who is struggling with this issue, this worked for me:

    in C:\Users\Username\AppData\Roaming\Code\User\settings.json just put:

    {
        "cucumberautocomplete.steps": [ "cypress/support/step_definitions/**/*.js"],
        "cucumberautocomplete.syncfeatures": "cypress/e2e/features/**/*.feature"
    }
    

    change it to your path, but the issue was, I need to use full path including cypress. After that restart VSCode and the referencing works.