Skip to content

Unable to find a step with two parameters #512

@RP-julietesilva

Description

@RP-julietesilva

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
});
  1. 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.
  2. 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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions