SpecFlow.VS
SpecFlow.VS copied to clipboard
NET6.0 - Features referencing step definitions using multiple scope tags causes 'ambiguous steps' warning
SpecFlow Version
3.9.40
Which test runner are you using?
NUnit
Test Runner Version Number
3.13.2
.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
No response
Issue Description
When tagging a feature with multiple tags that are associated to a step definition, the ambiguous definitions warning is shown. It will find as many definitions as tags that are matched.
Steps to Reproduce
- Open Visual Studio 2022
- Create new SpecFlow project
- Select a project name, directory, etc.
- Click Create
- Set framework to Net6.0
- Set test framework to NUnit
- Click Create, the default demo project will be created.
- Edit the file: Features/Calculator.feature
- Add @TagOne and @TagTwo to the top of the file.
- Save the file.
- Edit the file: StepDefinitions/CalculatorStepDefinitions.cs
- On the line under
[Binding]
decorator add the following:[Scope (Tag = "TagOne"), Scope (Tag = "TagTwo")]
- Save the file.
- Rebuild the project.
- Ambiguous definition warnings will now be displayed in Features/Calculator.feature
Link to Repro Project
No response
And at runtime you get no error?
Apologies for my slow response, that's correct. The project builds and SpecFlow generates .CS files without issue.
ok, then it is an issue with the VS extension. I will move the issue to the correct repo.
@SabotageAndi @PG-RichT
Hi,
its great that a bug is raised on Specflow bit, is there actually any plan to get it resolved?.
I have actually verified that the problem relates exactly to updating :
is there any work around for it?