You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added a step definition with a param (regular expression that should accept 2 different strings (collapse or expand)
then in the C# method I know how to behave depending on the param value.
But the step definition that is not reconized in feature files...
Steps to Reproduce
[When(@"I click on summary card ""(expand|collapse)"" button")]publicvoidWhenIClickOnSummaryCardCollapseExpandButton(stringcardAction){thrownew PendingStepExpception();}
But I've observed that if there is other params it works :
[When(@"I click on summary card ""(expand|collapse)"" button with label ""([^""]*)""")]publicvoidWhenIClickOnSummaryCardCollapseExpandButton(stringcardAction,stringlabel){thrownew PendingStepExpception();}
Link to Repro Project
No response
The text was updated successfully, but these errors were encountered:
This is likely because specflow since 4.0 allows both cucumber and regular expressions. This is automatically determined, but for this this step it makes an incorrect conclusion. To work around this you can write down the step as follow:
@"^I click on summary card ""(expand|collapse)"" button$"
to ensure it is always detected as a regular expression.
SpecFlow Version
4.0.31-beta
Which test runner are you using?
NUnit
Test Runner Version Number
3.13.3
.NET Implementation
.NET 6.0
Project Format of the SpecFlow project
Sdk-style project format
.feature.cs files are generated using
SpecFlow.Tools.MsBuild.Generation NuGet package
Test Execution Method
Visual Studio Test Explorer
SpecFlow Section in app.config or content of specflow.json
{
"$schema": "https://specflow.org/specflow-config.json",
"generator": {
"addNonParallelizableMarkerForTags": [ "nonparallelizable" ]
},
"runtime": {
"missingOrPendingStepsOutcome": "Error"
}
}
Issue Description
I added a step definition with a param (regular expression that should accept 2 different strings (collapse or expand)
then in the C# method I know how to behave depending on the param value.
But the step definition that is not reconized in feature files...
Steps to Reproduce
But I've observed that if there is other params it works :
Link to Repro Project
No response
The text was updated successfully, but these errors were encountered: