cucumber / vscode

Official Visual Studio Code Extension for Cucumber
MIT License
61 stars 16 forks source link

Auto Complete doesnt seem to work when using cypress #188

Closed afcbpeter1 closed 6 months ago

afcbpeter1 commented 7 months ago

👓 What did you see?

I've cloned this repo because I'd like to play around using cypress and cucumber.

https://github.com/eccanto/base-cypress-cucumber-typescript

However after installing the cucumber full support extension and doing npm i. I can't seem to get the glue to work on the feature file. Or in this case autocomplete.

Here is my settings.json any ideas?

{
    // Specify the directory where your step definitions are located
    "cucumberautocomplete.steps": [
      "cypress/e2e/steps/src/pages/*.ts",
      "cypress/e2e/steps/src/*.ts"
    ],

    // Enable strict Gherkin completion, ensuring consistent step definitions
    "cucumberautocomplete.strictGherkinCompletion": true,

    // Specify custom parameters to pass to your step definitions
    "cucumberautocomplete.customParameters": [

    ],

    // Define the directory where your feature files are located
    "cucumber.features": [
      "cypress/e2e/features"
    ],

    "cucumberautocomplete.syncfeatures": "cypress/e2e/features",

    // Set your preferred icon theme for the editor
    "workbench.iconTheme": "vscode-icons",
  }

✅ What did you expect to see?

I would expect to be able to go in to my step definition.

📦 Which tool/library version are you using?

Using VS code with Cypress and cucumber installed the cucumber full support extension.

🔬 How could we reproduce it?

Steps to reproduce the behavior:

  1. Clone the above repo.
  2. Add my settings to your vscode settings file.
  3. See that the autocomplete hasn't worked

📚 Any additional context?


This text was originally generated from a template, then edited by hand. You can modify the template here.

kieran-ryan commented 7 months ago

@afcbpeter1, it looks like you may be using the (Gherkin) Full Support extension rather than the official Cucumber extension (this repository). However, one key in your configuration file does relate to this extension (cucumber.features).

To use this extension, you will need to update your glob pattern for feature files from "cypress/e2e/features" to "cypress/e2e/features/**/*.feature" and you will also need to add a cucumber.glue key with a glob pattern for your step definition files. You can find more information on these extension settings in the README.

Your settings file should appear as follows:

{
    "cucumber.glue": [
        "cypress/e2e/steps/**/*.ts"
    ],
    "cucumber.features": [
        "cypress/e2e/features/**/*.feature"
    ]
}

If you'd like to try this out, I've pushed these changes to a fork of the linked repository. Please advise if this enables the extension to work for you.

afcbpeter1 commented 7 months ago

Thanks for this worked a treat