Test Schedule Run using vstest.console.exe | CI/CD

Step 1: Get Latest from TFS

cd "LocalBranchLocation"
"c:\Program Files (86)\Microsoft Visual Studio 14.0\Common7\IDE\TF.exe" get "$TFSBranchLocation"

Step 2: Built Dll

"c:\Program Files (86)\MSBuild\14.0\Bin\MSBuild.exe" "SolutionLocation/Solution.sln" /t:Clean,build

Step 3: Set custom config file to switch environment

type SolutionLocation\bin\debug\env.config > SolutionLocation\bin\debug\auto.dll.config 

Step 4: Run Test

"c:\Program Files (86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "DllLocation\solution.Dll"

Step 5: Copy result to target folder

xcopy "c:\TestResults" "TargetLocation" /E /C /H /R /K /O /Y



Leave a Reply