All Projects → stajs → Specflow.netcore

stajs / Specflow.netcore

Licence: mit
A (hopefully) temporary solution to get SpecFlow and .NET Core to play nice

Projects that are alternatives of or similar to Specflow.netcore

Notlitecode
Remote Encrypted Procedure Calling for .Net & .Net Core
Stars: ✭ 16 (-62.79%)
Mutual labels:  netcore
Drv3 Tools
(Not actively maintained, use DRV3-Sharp) Tools for extracting and re-injecting files for Danganronpa V3 for PC.
Stars: ✭ 13 (-69.77%)
Mutual labels:  experimental
Dispatchproxyasync
System.Reflection.DispatchProxy to Async Proxy
Stars: ✭ 33 (-23.26%)
Mutual labels:  netcore
Signalrsample
Real-time Charts with ASP.NET Core SignalR and Chart.js.
Stars: ✭ 23 (-46.51%)
Mutual labels:  netcore
Avenuenet
AvenueNet 是一个基于 Retrofit 二次封装的网络请求库,使用 Rxjava 的链式调用方式,二次封装的目的是为了对请求数据的正确性以及错误状态做统一的处理,对 Retrofit 对象做管理,有点为业务而生的味道,并非纯正的网络请求库
Stars: ✭ 10 (-76.74%)
Mutual labels:  netcore
Aws Lambda Dotnet
Libraries, samples and tools to help .NET Core developers develop AWS Lambda functions.
Stars: ✭ 945 (+2097.67%)
Mutual labels:  netcore
Reality
Comprehensive data proxy to knowledge about real world
Stars: ✭ 795 (+1748.84%)
Mutual labels:  experimental
Entityframeworkcore.indexattribute
Revival of [Index] attribute for EF Core. (with extension for model building.)
Stars: ✭ 37 (-13.95%)
Mutual labels:  netcore
Zircleui
🚀 zircle-ui is a frontend library to develop zoomable user interfaces.
Stars: ✭ 870 (+1923.26%)
Mutual labels:  experimental
Midiflip
🎹 MIDI music mayhem - flip, transpose, and arbitrarily remap pitches in MIDI files
Stars: ✭ 33 (-23.26%)
Mutual labels:  experimental
Mathos Parser
A mathematical expression parser and evaluation library.
Stars: ✭ 26 (-39.53%)
Mutual labels:  netcore
React Postcss
Simple style tag for React
Stars: ✭ 9 (-79.07%)
Mutual labels:  experimental
Restfulsense
A RESTFul operations client that serializes responses and throws meaningful exceptions for >= 400 status codes.
Stars: ✭ 28 (-34.88%)
Mutual labels:  netcore
Forex
Fortran User Defined Exceptions Handler
Stars: ✭ 17 (-60.47%)
Mutual labels:  experimental
Lyndacoursesdownloader
Cross platform .net core program to download lynda.com courses for offline use
Stars: ✭ 37 (-13.95%)
Mutual labels:  netcore
Tweetinvi
Tweetinvi, an intuitive Twitter C# library for the REST and Stream API. It supports .NET, .NETCore, UAP (Xamarin)...
Stars: ✭ 812 (+1788.37%)
Mutual labels:  netcore
Falcon
Enables Xkey / Hash-Two / Surrogate Key caching with Craft 2.x. Very experimental.
Stars: ✭ 14 (-67.44%)
Mutual labels:  experimental
Puppeteer Sharp Extra
Plugin framework for PuppeteerSharp
Stars: ✭ 39 (-9.3%)
Mutual labels:  netcore
Purefun
Functional Programming library for Java
Stars: ✭ 37 (-13.95%)
Mutual labels:  experimental
Cookedrabbit
CookedRabbit is a simple service based RabbitMQ wrapper for dealing with channels/connections.
Stars: ✭ 28 (-34.88%)
Mutual labels:  netcore

This repo is now archived because SpecFlow has caught up! A huge thanks to the many contributors! 🍻


⚠️ SpecFlow itself (and by extension this project) is currently limited to Windows platforms with .NET Framework v4.5.1+, or non-Windows with Mono.

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.3.0" />
        <PackageReference Include="SpecFlow" Version="2.1.0" />
        <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
        <PackageReference Include="xunit" Version="2.2.0" />
      </ItemGroup>
      
    • NUnit (Experimental):

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

      <ItemGroup>
        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
        <PackageReference Include="SpecFlow" Version="2.1.0" />
        <PackageReference Include="MSTest.TestAdapter" Version="1.1.18" />
        <PackageReference Include="MSTest.TestFramework" Version="1.1.18" />
      </ItemGroup>
      
  2. Include SpecFlow.NetCore:

    <ItemGroup>
      <DotNetCliToolReference Include="SpecFlow.NetCore" Version="1.3.5" />
    </ItemGroup>
    
  3. Add a precompile script:

    <Target Name="PrecompileScript" BeforeTargets="BeforeBuild">
      <Exec Command="dotnet SpecFlow.NetCore" />
    </Target>
    
  4. Build for your tests to be discovered.

    Note: there is a bug with the .NET Core CLI requiring a second build for newly added files to be discovered.

Cross platform using Mono

This has been tested on Windows, Ubuntu and macOS (High Sierra). It works in exactly the same way except it doesn’t use DotNetCli because it doesn’t work cross platform. Instead we call dotnet-SpecFlow.NetCore.exe directly from the package, this is why we need an extra PackageReference to SpecFlow.NetCore.

You also need to reference SpecFlow 2.2 or higher due to a Mono specific bug in SpecFlow.

<PropertyGroup>
      <SpecFlowNetCoreVersion>1.3.2</SpecFlowNetCoreVersion>
</PropertyGroup>
  
<ItemGroup>
   <PackageReference Include="SpecFlow.NetCore" Version="$(SpecFlowNetCoreVersion)" />
   
   <PackageReference Include="SpecFlow" Version="2.2.0" />
   <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
   <PackageReference Include="xunit" Version="2.2.0" />
</ItemGroup>

<Target Name="PrecompileScript" BeforeTargets="BeforeBuild">
  <Exec Command="mono $(NuGetPackageRoot)specflow.netcore/$(SpecFlowNetCoreVersion)/lib/$(TargetFramework)/dotnet-SpecFlow.NetCore.exe" />
</Target>

.NET Core & target frameworks

SpecFlow itself is currently limited to Windows platforms with full .NET Framework v4.5.1+. This means that two of the most common target frameworks are unsupported:

  • .NET Standard (unsupported)
  • .NET Core Application (unsupported)
  • .NET Framework

For .NET Framework, the following Target Framework Monikers (TFMs) are officially supported:

  • net46
  • net461

TFMs of net451 and above should support SpecFlow and this project, but have not been officially tested.

Visual Studio

Test Explorer

image

Samples

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

Background

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].