Skip to content

Steps with parameters Go To Definition open the same step #517

@gustavo-aily

Description

@gustavo-aily

Opening the new issue coming from @alexkrechik in another issue.

@gustavo-aily This is another issue (the current one is related to the 2+ params of the same type).
BTW, do you need your steps to be used as RegEx? (you could try "cucumberautocomplete.pureTextSteps": true,)

Originally posted by @alexkrechik in #512


Hello!
In my team we're experience an issue related to the recognition of steps. We're working with CursorAI. Parameter-less steps are correctly redirected to the correct definition, but the steps that have parameters, are redirected to the same step definition, regardless of the steps itself.

IMPORTANT: Executions are working, is more an issue of quickly opening the step when coding/debugging

Examples of both keywords are OK (no squiggly line). When clicked the Go To Definition:

When I wait until table 'Premium Items' is displayed -> Takes me to the step definition of "@given("I login to the app")"
When I open the 'Priorities' page -> Takes me to the step definition of "@given("I login to the app")"
When I hover over a random row with analyzer icon -> Takes me to the correct definition.

We're defining the steps like this:

@then("I expect to display priority name '{priority_name}'")
def step_impl(context: Context, priority_name):
   ...

@when("I apply '{text_value}' filter in the search bar of the priority filter")
def step_impl(context: Context, text_value: str):
   ...

@given("I login to the app")
def step_impl(context: Context):
   ...

Our settings.json looks like this

    "cucumberautocomplete.steps": [
        "qa_automation/e2e_ui/steps/**/*.py"
    ],
    "cucumberautocomplete.syncfeatures": "qa_automation/e2e_ui/features/**/*.feature",
    "cucumberautocomplete.strictGherkinCompletion": true,
    "cucumberautocomplete.smartSnippets": true,
    "cucumberautocomplete.stepsInvariants": true,
    "cucumberautocomplete.pureTextSteps": false,

Regarding the use of Regex, it would imply a big big big change in all the code. If this can be avoided, we would like to check another possible solution (if there's any) 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions