Configure Specflow for Freestyle

Prerequisites

1) MSBuild Plugin

2) VSTest Runnner Plugin

3) Visual Studio IDE setup or Visual Studio Build Tools setup on server


Step 1: Checkout Source Code.



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



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




Step 4: Select a build step for MSBuild in Build Section.





Step 5: 1)Select "MSBuild Version" which is configured in Global Tool Configuration


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



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


Step 7: Select a build step for VSTest in Build Section.



Step 8:   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)Uncheck "Enable Code Coverage" checkbox




Configure Specflow for Pipeline


Prerequisites

1) VSTest Runnner Plugin

2) Visual Studio IDE setup or Visual Studio Build Tools setup on server


Step 1: Checkout Source Code.

checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/lizamathew/Spec-Flow-Demo.git']]])


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

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


Step 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)


Step 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


Go to Main Page

Attachments:

Build with Parameters.png (image/png)
Post Build Action.png (image/png)
Parameters Added.png (image/png)
Parameterized checkbox.png (image/png)
QTMtestExe Screen.png (image/png)
Pipleline Console.png (image/png)
Adv Project Options.png (image/png)
Build Triggers.png (image/png)
General.png (image/png)
Enter Item name.png (image/png)
Pipeline Script.png (image/png)
New item.png (image/png)
vstestconfig6.png (image/png)
Add vstestconfig6a.png (image/png)
vstestexe5.png (image/png)
Server Freestyle config.png (image/png)
Cloud Freestyle config.png (image/png)
msbuildconfig4.png (image/png)
Add msbuildconfig4a.png (image/png)
msbuildExecutable3.png (image/png)
script2.png (image/png)
git config-1.png (image/png)
Config Freestyle Server.png (image/png)
Config Freestyle Cloud.png (image/png)
Server ScreenShot.jpg (image/jpeg)
Cloud ScreenShot.jpg (image/jpeg)
Test Result.png (image/png)
Success.png (image/png)
SCM.png (image/png)
Post Build actions.png (image/png)
Post Build action menu.png (image/png)
Post Build action Cloud2.png (image/png)
Post Build action Cloud.png (image/png)
Item Name.png (image/png)
Git.png (image/png)
Build.png (image/png)
Add build step.png (image/png)