Search code examples
visual-studio-codecucumbercypressshortcut

Is it possible to navigate from feature file to step definition and vice versa in Cypress (VSCode)


I'm using cypress cucumber test framework and IDE VSCode I can't find a way to navigate from feature to step definition and vice versa. I have installed Cucumber (Gherkin) Full Support extension in vs code but doesn't help

Is there any config which enables navigation from feature to step definition?


Solution

  • Plesase navigate in VSCode File > Preferences > Settings (Code > Preferences > Settings on Mac) then select Workspace.

    workspace

    Open settings.json file from top-right corner.

    settings.json

    Set following settings in your settings.json file and save the file. Please keep your hierarchy of files.

    "cucumberautocomplete.steps": [
         "cypress/integration/*/*.js"
       ],
    "cucumberautocomplete.syncfeatures": "cypress/integration/*.feature",
    "cucumberautocomplete.strictGherkinCompletion": false,
    "cucumberautocomplete.smartSnippets": true,
    "cucumberautocomplete.stepsInvariants": true
    

    Now open your feature file, place your curson on step line, press CTRL and Right click on line or press F12.