-
Notifications
You must be signed in to change notification settings - Fork 0
Advanced Project Setup
The SpecFlow tests are usually placed into one or more separate project in the solution: the "SpecFlow Projects".
The Project Setup Guide on our website provides a basic introduction to SpecFlow. This page contains a detailed description of the possibilities.
This list describes the recommended setup options. For alternatives check the Advanced setup options section below.
Since SpecFlow can use different unit testing frameworks to execute the SpecFlow tests, the SpecFlow projects have to be either Test Projects (in case of MsTest) or a simple Class Libraries. Just like for unit tests, it makes sense to keep a consistent naming convention for these projects (usual project name postfixes are Specs or AcceptanceTests).
SpecFlow projects need the TechTalk.SpecFlow.dll in order to compile. You can setup this by installing our NuGet package: [[SpecFlow|http://www.nuget.org/packages/SpecFlow]] or one of the specific helper packages.
PM> Install-Package SpecFlow
If you have used one of the helper NuGet packages you don't need to configure anything. If you have used the SpecFlow package or want to fine tune SpecFlow, you need to change the settings in the App.config file. See Configuration page for details.
Your project is ready to use SpecFlow. You can add the first feature files (with Add / New Item in Visual Studio for example) and implement your applications in a Behavior Driven Development style.
For a manual project setup (without NuGet packages), you should copy all SpecFlow assemblies to the project's folder structure to have better upgrade and tool support. You can download the binary package that contains all the necessary files.
SpecFlow projects need the TechTalk.SpecFlow.dll (or one of the platform-specific variants) in order to compile. You have to add a reference to the SpecFlow project for the copied TechTalk.SpecFlow.dll (in the bin\{platform} folder of the binary package).
The SpecFlow IDE integration tries to find the generator component of in your project structure to be able to use the generator version that matches to the SpecFlow runtime used in this project.
If you have used the NuGet package or kept the original structure of the binary package folders, it will find it without any extra configuration (based on the reference for the TechTalk.SpecFlow.dll assembly). In any other cases, you should consider the following discovery rules (the are presented in order of priority, highest first).
The IDE integration checks the generator in the following paths:
- generator path configured in app.config (
<generator path="..\lib\SpecFlow"/>, see Configuration) - generator assembly (
TechTalk.SpecFlow.Generator.dll) referenced from the SpecFlow project - generator in the same folder as the runtime (
TechTalk.SpecFlow.dll) - generator is "near" to the runtime (
toolsor..\tools, relative to the runtime) - generator obtained through NuGet (
..\..\tools, relative to the runtime)
If SpecFlow cannot find the generator or it is older than v1.6.0, the installed SpecFlow generator is used. If you use any custom plugins (e.g. unit test generator), this has to be in the same folder as the generator currently.
SpecFlow is also distributed as a binary package. This package contains the assemblies that should be placed to the project folder. Here is a detailed list though:
TechTalk.SpecFlow.dllTechTalk.SpecFlow.Generator.dllTechTalk.SpecFlow.Parser.dllTechTalk.SpecFlow.Utils.dllGherkin.dll-
IKVM.*.dll(5 assemblies) -
specflow.exe(optional) -
TechTalk.SpecFlow.Reporting.dll(optional) -
TechTalk.SpecFlow.targets(optional) -
TechTalk.SpecFlow.tasks(optional)