Setup SpecFlow in MacOS with VisualStudio 2019

I was excited when .NET finally released VisualStudio 2019 for macOS. So I installed it in order to be able to work with SpecFlow. Unfortunately, SpecFlow does not have a plugin for macOS.

After some search, I finally found there is a plugin for SpecFlow for macOS. It is just not officially built by the SpecFlow itself. 

Create a project in MacOS with VS2019:

  1. Create a new Project with type NUnit
  2. Choose the version of .NET core ( I chose 3.1)
  3. Set the project name and location

Install the SpecFlow extension

  1. Download the extension from in https://github.com/straighteight/SpecFlow-VS-Mac-Integration
  2. go to menu Visual Studio > Extension. 
  3. The extension manager will be displayed and then click the “Install from file”. It will install the SpecFlow extension.

Add SpecFlow NuGet packages to Project:

  1. Right-click the project > Manage Nuget Packages
  2. Type SpecFlow in the search bar
  3. Choose SpecFlow, SpecFlow NUnit, SpecFlow.Tools.MSBuild.Generation

Add Feature Files:

The only thing that I am missing here is the auto-generation of a step definition. The extension does not have that capability. Therefore, we need to make it ourselves. 

Leave a Reply

Your email address will not be published. Required fields are marked *