-
Notifications
You must be signed in to change notification settings - Fork 750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SpecFlow for VS2022 plugin: poor regex recognition #2740
Labels
Comments
'(?: and wait)?' also doesn't work |
'(?: and wait)? does work in Reqnroll , can you migrate to Reqnroll? |
unfortunately not with current customer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SpecFlow Version
3.9.74
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
Issue Description
For step definition such as:
[When(@"I click the (.*) element( and wait)?"]
public async Task IClickElement(string elementName, string optionalWait="")
`
Specflow 3.9.74 recognizes it correctly during execution, regardless if " and wait" is present in the step or not. Both in VS TestExplorer, as well as with command line.
Command line: dotnet test --environment /here some settings to indicate testing environment, not relevant here/
But "SpecFlow for Visual Studio 2022" v2022.1.93 - 2023-11-28 fails to recognize this regex in step definition.
Underlined steps in VS have error:
"The method BaseSteps.IClickElement(String, String) has invalid parameter count, 1 parameter(s) expected"
This time I can resort to changing step def to
[When(@"I click the (.*) element(| and wait)"]
but in the past (and java) there had been steps I could not go for such workaround. Better regex implementation to the plugin would be nice, especially that the specflow library itselt / dotnet dit not have issues during execution of this step.
Steps to Reproduce
[When(@"I click the (.*) element( and wait)?"]
public async Task IClickElement(string elementName, string optionalWait="")
`
with
"The method BaseSteps.IClickElement(String, String) has invalid parameter count, 1 parameter(s) expected" message
(but runtime works).
Link to Repro Project
No response
The text was updated successfully, but these errors were encountered: