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

Unable to find a step with two parameters #512

Open RP-julietesilva opened 4 weeks ago

RP-julietesilva commented 4 weeks ago

Describe the bug A step with only one parameter redirects correctly, but when I add a second parameter, the step cannot be found.

To Reproduce Steps to reproduce the behavior:

  1. Create a step in the feature file, eg: When the user recharges a "monthly" transport card for "Bus"
  2. Create the corresponding step in the step definition file, eg:
    When('the user recharges a {string} transport card for {string}', async (creditType: string, cardType: string) => {
    // Step logic here
    });
  3. Then, go back to the feature file and click on the step to redirect. A message will appear stating that the step could not be found.
  4. If one parameter is removed, for example: Gherkin: When the user recharges a "monthly" transport card for Bus Step:
    When('the user recharges a {string} transport card for Bus', async (creditType: string) => {
    // Step logic here
    });

    then the redirection works correctly.

Expected behavior The step should be found with two or more parameters.

Screenshots image

Cucumberautocomplete part of VSCode settings:

{
  "cucumberautocomplete.steps": ["e2e/scenarios/step_definitions/*.ts"],
  "cucumberautocomplete.syncfeatures": "e2e/scenarios/features/*.feature",
  "cucumberautocomplete.strictGherkinCompletion": false,
  "cucumberautocomplete.stepsInvariants": true,
  "cucumberautocomplete.pureTextSteps": true
}

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

When('the user recharges a {string} transport card for {string}', async (creditType: string, cardType: string) => {
    // Step logic here
});

Gherkin step line If applicable, add step line from gherkin file When the user recharges a "monthly" transport card for "Bus"