SpecFlow icon indicating copy to clipboard operation
SpecFlow copied to clipboard

How to add specflow to an existing xunit testproject

Open kwaazaar opened this issue 3 years ago • 2 comments

SpecFlow Version

2019.0.95.11469

Which test runner are you using?

xUnit

Test Runner Version Number

2.4.3

.NET Implementation

.NET 5.0

Project Format of the SpecFlow project

Sdk-style project format

.feature.cs files are generated using

SpecFlowSingleFileGenerator custom tool

Test Execution Method

Visual Studio Test Explorer

SpecFlow Section in app.config or content of specflow.json

???

Issue Description

A new specflow project works fine in VS, but when trying to add specflow stuff to an existing xunit project, no Specflow templates are shown. Why cannot I add specflow to an existing xunit testproject?

Steps to Reproduce

See above

Link to Repro Project

No response

kwaazaar avatar Jul 27 '21 12:07 kwaazaar

I think I got it. My project uses Microsoft.NET.Sdk.Web. If I change a working specflow project to use this sdk, then things stop working too.

But this in an integration test for my service. Integration tests are, from my point of view, the type of tests that can most benefit from SpecFlow. Would be really nice if you could support these.

Documentation on integration test projects: https://docs.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-5.0#test-app-prerequisites

kwaazaar avatar Jul 27 '21 12:07 kwaazaar

As far as I understood the problem is that if you have a test project, where the Sdk is Microsoft.NET.Sdk.Web, the Visual Studio Extension does not offer the Item templates: image For Microsoft.NET.Sdk: image

epresi avatar Jul 28 '21 05:07 epresi