SpecFlowOSS / SpecFlow.VS

The next version of the Visual Studio extension for SpecFlow
MIT License
39 stars 12 forks source link

Ambiguous steps displayed in Visual Studio 2022 when Specflow.Autofac higher than 3.9.58 is referenced #101

Open vikingkom opened 2 years ago

vikingkom commented 2 years ago

SpecFlow Version

Ambiguous steps displayed in Visual Studio 2022 when Specflow.Autofac higher than 3.9.58 is referenced

Which test runner are you using?

NUnit

Test Runner Version Number

4.2.1

.NET Implementation

.NET 5.0

Project Format of the SpecFlow project

Classic project format using <PackageReference> tags

.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

Same issue as https://github.com/SpecFlowOSS/SpecFlow.VS/issues/91

I suspect this block because it registers the assembly twice.

Steps to Reproduce

  1. Create an empty NUnit project.
  2. Use Visual Studio 2022 Specflow extension v2022.1.66
  3. PackageReferences:
  4. Add feature file and generate step definitions.

image

Link to Repro Project

https://drive.google.com/file/d/1LRTVHFlPHKGIbwOzJsv_zGFHFocgT5aG/view

Radamonas commented 2 years ago

We faced this problem as well.

lampie1973 commented 1 year ago

I had the same problem but could fix it by editing the Specflow.json file. We still had some 'assembly' items in there which are no longer valid. Using something like this will fix it { "$schema": "https://specflow.org/specflow-config.json", "ide": { "editor": { "gherkinFormat": { "indentDataTable": false, "indentExamples": true, "indentExamplesTable": false } } } }

sergheizagaiciuc commented 1 year ago

Facing the same problem. It did not help to make specflow.json file look like the one proposed by @lampie1973

Spaier commented 1 year ago

Facing the same issue with xUnit and Specflow.Autofac

AndrewScott-Ingram commented 1 year ago

I have the same issue, SpecFlow.Autfac 3.9.74 and v2022.1.91 of the extension, its making using Specflow painful

Henriqueba210 commented 1 year ago

Also if you use Autofac along with XUnit for some reason the Visual Studio extension tries to run the functions that create the Test Dependencies and depending on what you do on startup it makes the whole discovery process fail. This behavior doesn't happen on Rider but it's an issue for my team since some of my colleagues only have a license for Visual Studio.

arzion commented 1 year ago

Got it fixed removing SpecFlow.Autofac package. It will also remove such errors/warnings if you downgrade SpecFlow.Autofac and related packages versions.

shivumm commented 11 months ago

Any further update on the issue, still facing the same issue , please let us know if any alternative to resolve the same.

maoso commented 8 months ago

Any update about this issue?