Mufu.SpecFlow.DotNetCoreFix 1.0.2

Lets you run SpecFlow tests on .NET Core 2.0

There is a newer version of this package available.
See the version list below for details.
Install-Package Mufu.SpecFlow.DotNetCoreFix -Version 1.0.2
dotnet add package Mufu.SpecFlow.DotNetCoreFix --version 1.0.2
<PackageReference Include="Mufu.SpecFlow.DotNetCoreFix" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mufu.SpecFlow.DotNetCoreFix --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

.NET Core fix for SpecFlow

This is a fix for anybody trying to use SpecFlow with .NET Core 2.0, inspired by the work of SpecFlow.DotNet and SpecFlow.xUnitAdapter.

Currently, SpecFlow doesn't officially support .NET Core, despite ongoing work in that area. Until that offical support arrives, this fix allows you to run SpecFlow as part of a .NET Core test suite.

Installation

Install the latest release candidate from NuGet:

Install-Package Mufu.SpecFlow.DotNetCoreFix -IncludePrerelease

If you're running SpecFlow on anything other than NUnit, you need to use version 2.2.0 of SpecFlow or newer and have a specflow.json file in your test project. This file must be set to be copied to your output folder on every build and is used to configure your test runner (e.g. xunit):

{
    "specflow": {
        "unitTestProvider": {
            "name": "xunit"
        }
    }
}

You must also add this property your test project to make sure your copy of the SpecFlow assembly sits in your output folder alongside the specflow.json file.

<PropertyGroup>
    <!-- ... -->
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
    <!-- ... -->
</PropertyGroup>

How it works

This project is an extension to MSBuild which invokes the specflow.exe tool during the build process. The tool generates the *.feature.cs files normally produced by the SpecFlow extension to Visual Studio.

The specflow.exe tool runs using the .NET Framework and only works on .NET Framework projects. The DotNetCoreFix package generates a shadow project using the classic project structure, including an app.config file configured to the test framework you're using, and copies in all the *.feature files from your project. The output *.feature.cs files are added to the source files for the build, so the unit tests appear in the compiled assembly.

.NET Core fix for SpecFlow

This is a fix for anybody trying to use SpecFlow with .NET Core 2.0, inspired by the work of SpecFlow.DotNet and SpecFlow.xUnitAdapter.

Currently, SpecFlow doesn't officially support .NET Core, despite ongoing work in that area. Until that offical support arrives, this fix allows you to run SpecFlow as part of a .NET Core test suite.

Installation

Install the latest release candidate from NuGet:

Install-Package Mufu.SpecFlow.DotNetCoreFix -IncludePrerelease

If you're running SpecFlow on anything other than NUnit, you need to use version 2.2.0 of SpecFlow or newer and have a specflow.json file in your test project. This file must be set to be copied to your output folder on every build and is used to configure your test runner (e.g. xunit):

{
    "specflow": {
        "unitTestProvider": {
            "name": "xunit"
        }
    }
}

You must also add this property your test project to make sure your copy of the SpecFlow assembly sits in your output folder alongside the specflow.json file.

<PropertyGroup>
    <!-- ... -->
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
    <!-- ... -->
</PropertyGroup>

How it works

This project is an extension to MSBuild which invokes the specflow.exe tool during the build process. The tool generates the *.feature.cs files normally produced by the SpecFlow extension to Visual Studio.

The specflow.exe tool runs using the .NET Framework and only works on .NET Framework projects. The DotNetCoreFix package generates a shadow project using the classic project structure, including an app.config file configured to the test framework you're using, and copies in all the *.feature files from your project. The output *.feature.cs files are added to the source files for the build, so the unit tests appear in the compiled assembly.

Release Notes

Added full support for binding generated test files to their source  .feature files.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.3 331 5/29/2018
1.1.2 286 5/27/2018
1.0.3 581 4/12/2018
1.0.3-alpha 274 3/27/2018
1.0.2 330 2/15/2018
1.0.1 308 2/14/2018
1.0.0 288 2/14/2018
1.0.0-rc4a 268 11/2/2017
1.0.0-rc4 236 11/1/2017
1.0.0-rc3 301 10/25/2017
1.0.0-rc2 257 10/23/2017
Show less