Giter Club home page Giter Club logo

specflow.netcore's Introduction

SpecFlow.NetCore

The problem

As at the time of writing (September 2016), the SpecFlow for Visual Studio 2015 extension does not play well with .NET Core projects.

The solution

Wait for the VS extension to support .NET Core projects. In the meantime, I present...

The (hopefully temporary) solution

Update your project:

  1. Include SpecFlow and your test framework of choice:
  • xUnit:

    <ItemGroup>
      <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
      <PackageReference Include="SpecFlow" Version="2.1.0" />
      <PackageReference Include="xunit" Version="2.2.0-beta5-build3474" />
      <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta5-build1225" />
    </ItemGroup>
  • NUnit (Experimental):

    <ItemGroup>
      <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
      <PackageReference Include="SpecFlow" Version="2.1.0" />
      <PackageReference Include="NUnit" Version="3.4.1" />
     <PackageReference Include="dotnet-test-nunit" Version="3.4.0-beta-2" />
    </ItemGroup>
  • MsTest (Experimental):

    <ItemGroup>
      <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
      <PackageReference Include="SpecFlow" Version="2.1.0" />
      <PackageReference Include="MSTest.TestFramework" Version="1.0.8-rc" />
      <PackageReference Include="MSTest.TestAdapter" Version="1.1.8-rc" />
    </ItemGroup>
  1. Include SpecFlow.NetCore:
<ItemGroup>
  <DotNetCliToolReference Include="SpecFlow.NetCore" Version="1.0.0-rc8" />
</ItemGroup>
  1. Add a precompile script:
<Target Name="PrecompileScript" BeforeTargets="BeforeBuild">
  <Exec Command="dotnet SpecFlow.NetCore" />
</Target>
  1. Build for your tests to be discovered.

Notes

Samples

If you build the samples solution, you should see .feature.cs files and an app.config being generated for each test framework.

Supported frameworks

.NET Core

  • netcoreapp1.0
  • net46
  • net461

Test frameworks

  • xUnit
  • NUnit - Experimental support added by the community.
  • MsTest - Experimental support added by the community.

Visual Studio

Test Explorer

image

Background

specflow.netcore's People

Contributors

stajs avatar smudge202 avatar erik-inkapool avatar richardjharding avatar revlucio avatar bowman-jm avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.