SpecFlow.VS icon indicating copy to clipboard operation
SpecFlow.VS copied to clipboard

NET6.0 - Features referencing step definitions using multiple scope tags causes 'ambiguous steps' warning

Open PG-RichT opened this issue 3 years ago • 4 comments

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.

image

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

PG-RichT avatar Jan 24 '22 14:01 PG-RichT

And at runtime you get no error?

SabotageAndi avatar Jan 26 '22 15:01 SabotageAndi

Apologies for my slow response, that's correct. The project builds and SpecFlow generates .CS files without issue.

PG-RichT avatar Feb 01 '22 11:02 PG-RichT

ok, then it is an issue with the VS extension. I will move the issue to the correct repo.

SabotageAndi avatar Feb 02 '22 16:02 SabotageAndi

@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 : image

is there any work around for it?

PawelBurzynskiGoris avatar Nov 14 '22 13:11 PawelBurzynskiGoris