SpecFlow Runner Installation
SpecFlow+ Runner and SpecFlow+ Excel are distributed as NuGet package. Both components require SpecFlow to be installed as well. SpecFlow is also available as a NuGet package of its own, but installing one of the SpecFlow+ packages automatically installs the SpecFlow NuGet package as well.
The installation of SpecFlow and SpecFlow+ Runner is described in detail in the Getting Started guide for SpecFlow. The installation of the SpecFlow components is also covered in the SpecFlow documentation.
Details on installing SpecFlow+ Excel can be found here.
Information on installing SpecFlow+ LivingDoc can be found here.
Installation and Setup
Installing SpecFlow consists of two steps:
- Install the IDE integration
- Set up your Visual Studio project to work with SpecFlow
Installing the IDE Integration Packages
The method used to install the IDE Integration packages depends on your IDE:
- Visual Studio 2010+ (including Community Edition but not Express Edition): The easiest method is to select Tools | Extensions and Updates from the menu in Visual Studio, switch to the Online search on the left and enter “SpecFlow” in the search field at the top right.
- Visual Studio Express: Refer to Install IDE Integration for direct download links and information on installing SpecFlow for other IDEs.
Setting Up your SpecFlow Project
Once you have installed the Visual Studio integration, you need to set up your solution to use SpecFlow. SpecFlow tests are usually placed in separate projects in your solution. The quickest way to set up a project is add the NuGet package to your project. For a detailed project setup guide, see the Setup SpecFlow Projects page.
To set up your specification project:
- Add "Unit Testing Project" to your solution (e.g. "MyProject.Specs").
Note: Creating a “Unit Test Project” is the recommended procedure, as it reduces the number of steps required to set up your project.
- You can choose to remove the UnitTestX.cs file, as it is not required.
- Add SpecFlow+ Runner to your specification project using NuGet:
Installing SpecFlow+ Runner automatically downloads the SpecFlow runtime from NuGet and adds it to your specifications project.
- Right-click on your specification project (e.g. “MyProject.Specs”) and select Manage NuGet Packages for Solution.
- Search for “SpecRun” and install SpecRun for SpecFlow. The latest version is installed automatically, although you can choose to install an earlier version if needed.
Alternatively, you can install the package from NuGet's console (Tools | NuGet Package Manager | Package Manager Console) as follows:
PM> Install-Package SpecRun.SpecFlow
For details on registering SpecFlow+ Runner, see Registering SpecFlow+.