1. Configure a Project

Applies to TestLeft 15.40, last modified on March 17, 2022

1. Install the SpecFlow Extension

  1. Run Visual Studio.

  2. Select Tools > Extensions and Updates from the main menu:

    SpecFlow test with TestLeft: Select Extensions and Updates

    Click the image to enlarge it.

  3. In the subsequent dialog, switch to the Online tab, search for SpecFlow and download the SpecFlow extension:

    SpecFlow test with TestLeft: Installing SpecFlow

    Click the image to enlarge it.

    Follow the instructions to install the extension. You may need to close Visual Studio during the installation.

2. Create a Project

  1. In Visual Studio, select File > New > Project to create a new project:

    SpecFlow test with TestLeft: Creating new project in Visual Studio

    Click the image to enlarge it.

  2. In the New Project dialog, create a new unit test project:

    SpecFlow test with TestLeft: Creating Unit Test project

    Click the image to enlarge it.

    Visual Studio will create the project from a template.

  3. Remove the UnitTest1.cs file from the created project. We will not use it in this tutorial. To do this, right-click the file in the Solution Explorer and select Delete from the context menu:

    SpecFlow test with TestLeft: Remove file in Visual Studio

3. Install NuGet Packages

  1. Right-click your solution in the Solution Explorer and select Manage NuGet Packages for Solution:

    SpecFlow test with TestLeft: Adding SpecFlow extension

    Click the image to enlarge it.

  2. In the subsequent window, switch to the Browse tab, type SpecFlow in the search field and install the SpecFlow package to your project:

    SpecFlow test with TestLeft: Installing SpecFlow package to a project

    Click the image to enlarge it.

  3. To run SpecFlow tests, you will use the MSTest unit test provider. To be able to do that, install the SpecFlow.MsTest package. Type SpecFlow.MsTest in the search field and install the package to your project:

    SpecFlow test with TestLeft: Installing SpecFlow package to a project

    Click the image to enlarge it.

4. Add a TestLeft Reference

  1. Right-click the References item in the Solution Explorer and select Add Reference:

    SpecFlow test with TestLeft: Adding reference to the project
  2. Search for TestLeft and check the SmartBear.TestLeft.12 assembly:

    SpecFlow test with TestLeft: Adding TestLeft assembly

    Click the image to enlarge it.

Prev     Next

See Also

Behavior-Driven Development
About Behavior-Driven Development

Highlight search results