Unable to use Cucumber step expression
Hello,
I would like to use Cucumber step expression like in : https://vitest-cucumber.miceli.click/features/step-expression/ to be able to use parameter in cucumber step but the value of the parameter is always "undefined".
For example, my cucumber step is :
When the user fill "test" in the field
And the step definition is :
When('the user fill {string} in the field', async(ctx : TestContext, value: string) => { await appiumActions.fillInputByKey( 'search_input', value ); });
Then the value of the parameter "value" is always "undefined". What is the problem ?
I'm using @amiceli/vitest-cucumber": "^5.2.1" with "vitest": "^3.2.4".
Thank you in advance. Best regards.
You have a typo error. In feature you have When the use fill "test" in the field, but in spec you have the useR.
A r in missing in your When.
Event if an example of code who it works :
When(
"the user fill {string} in the field",
async (ctx: TestContext, value: string) => {
expect(value).toEqual("test")
},
)
Thank you for you answer @amiceli . Sorry for the typo in my description but in my code there is no typo issue. If it was a problem with the typo, I should have the "StepAbleUnknowStepError".
Weird, I've same versions but value isn't undefined.
Can you share full Scenario from feature and spec files ?