Specflow

Configure Specflow for Freestyle

Note

Prerequisites:

  • MSBuild Plugin

  • VSTest Runnner Plugin

  • Visual Studio IDE setup or Visual Studio Build Tools setup on server

Perform the following steps to configure Specflow for Freestyle:

  1. Check out the Source Code.

  2. Add Script to update packages for msbuild using NuGet.exe file from checkout repository.

  3. Configure msbuild executable in Manage Jenkins > Global Tool Configuration > MSTest.

  4. Select a build step for MSBuild in the Build Section.

  5. Perform the following steps:

    1. Select MSBuild Version, which is configured in the Global Tool Configuration.

    2. Specify the relative path for the solution file in MSBuild Build File.

  6. Configure the vstest executable in Manage Jenkins > Global Tool Configuration > VSTest.

  7. Select a build step for VSTest in the Build Section.

  8. Perform the following steps:

    1. Select VSTest Version which is configured in Global Tool Configuration.

    2. Specify the relative path to your VSTest compiled assemblies in Test Files.

    3. Clear the Enable Code Coverage checkbox.

Configure Specflow for Pipeline

Note

Prerequisites:

  • VSTest Runner Plugin

  • Visual Studio IDE setup or Visual Studio Build Tools setup on server

Perform the following steps to configure Specflow for Pipeline:

  1. Check out the Source Code.

    checkout([$ class : 'GitSCM' , branches: [[name: '*/master' ]], doGenerateSubmoduleConfigurations: false , extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/lizamathew/Spec-Flow-Demo.git' ]]])
  2. Add a Script to update packages for MSBuild using NuGet.exe file from the checkout repository.

    bat 'C:/Users/liza.mathew/.jenkins/workspace/PipelineSpecflowProjectMaster/Specflow/.nuget/NuGet.exe update -self'
  3. Configuration for MSBuild.

    bat "\"${tool 'MSBuild'}\" Specflow/SpecResults.sln" (MSBuild is a tool configured for path to MSBuild executable then specify relative path for solution file of project)
  4. Configuration of VSTest. VSTest is a tool configured for path to VSTest executable.

    step([$ class : 'VsTestBuilder' , 'vsTestName' : '${tool VSTest}' , enablecodecoverage : false , 'testFiles' : 'Specflow/SpecResults.ApprovalTestSuite/bin/Release/SpecResults.ApprovalTestSuite.dll' ])
  • vsTestName: path to VSTest executable

  • testFiles: specify relative path to your VSTest compiled assemblies

Publication date: