After implementing 3 step bindings with advanced regex, some steps in feature file start to be unrecognized (which beginnings And, When or Then are not recognized as keywords, but simple black text).
Regex:
[Given(@"Slave side is configured( with ""([0-9, ]*)"" byte block analyzer)?")]
[Then(@"Channel\s*(with "".+"")? is ""(Connected|Disconnected|Connecting|NoReply)""")]
[When(@"Channel( with "".+"")? is ""(Connected|Disconnected|Connecting|NoReply)""")]
We have different steps in feature files and we try to utilize one step binding so regex for that step binding ends with a bit advance pattern. We have capturing groups inside, but what i noticed that makes this problem is optional space before capturing group. I tried to match optional space with different patterns - \s*, \s{0,1}, {0,1}, i also tried to put space inside capturing group with removing space matching pattern before capturing group.
Also, there are errors showing in output window when tracer for specflow is enabled. But tricky thing is that when i comment any of step bindings there are 4 or less errors and parser seems to behave nice when, at least that is what i noticed. When there are 6 errors (3 step bindings), then this problem occurs.
ProjectFeatureFilesTracker: Cannot detect generated test version for file: SpecFlowFeature1.feature, error: Version string portion was too short or too long.
Same thing happens in Visual Studio 2019 and SpecFlow for Visual Studio 2019
SpecFlow Version:
Used Test Runner
Version number: 2.6.2.12296
Project Format of the SpecFlow project
packages.config
<PackageReference>
tags.feature.cs files are generated using
SpecFlow.Tools.MsBuild.Generation
NuGet packageSpecFlowSingleFileGenerator
custom toolVisual Studio Version
Enable SpecFlowSingleFileGenerator Custom Tool
option in Visual Studio extension settingsAre the latest Visual Studio updates installed?
.NET Framework:
Test Execution Method:
<SpecFlow> Section in app.config or content of specflow.json
Repro Project
https://github.com/StefanZivkovic/SpecFlow
Issue Description
After implementing 3 step bindings with advanced regex, some steps in feature file start to be unrecognized (which beginnings And, When or Then are not recognized as keywords, but simple black text). Regex:
We have different steps in feature files and we try to utilize one step binding so regex for that step binding ends with a bit advance pattern. We have capturing groups inside, but what i noticed that makes this problem is optional space before capturing group. I tried to match optional space with different patterns -
\s*
,\s{0,1}
,{0,1}
, i also tried to put space inside capturing group with removing space matching pattern before capturing group. Also, there are errors showing in output window when tracer for specflow is enabled. But tricky thing is that when i comment any of step bindings there are 4 or less errors and parser seems to behave nice when, at least that is what i noticed. When there are 6 errors (3 step bindings), then this problem occurs.ProjectFeatureFilesTracker: Cannot detect generated test version for file: SpecFlowFeature1.feature, error: Version string portion was too short or too long.
Same thing happens in Visual Studio 2019 and SpecFlow for Visual Studio 2019
Steps to Reproduce
Details in Issue Description