Search Here!

Tuesday, August 28, 2012

Continuous Integration: Generate SpecFlow Report with append Time Stamp

This Batch code calls the MSTest latest trx file and convert it into SpecFlow HTML report and save it with appending Time Stamp  and copy the HTML file in other driver for public access. This we majorly implemented and used in the CI that calls this batch file through MSBuild Definition and execute the Batch Commands.


set SAVESTAMP=%DATE:/=-%@%TIME::=-%
set SAVESTAMP=SMOKERESULT_%SAVESTAMP: =%.html

for /f "delims=" %%x in ('dir /od /a-d /b E:\B2\TestResults\*.*') do set recent=%%x    //Path of the directory where trx file resides.

echo %recent%

REM Remove space from the file name here

set OldFileName=%recent%

set NewFileName=%OldFileName: =%

ren "E:\B2\TestResults\%OldFileName%" %NewFileName%

"C:\Program Files\TechTalk\SpecFlow\SpecFlow.exe" mstestexecutionreport E:\B2\Sources\PegasusBDD\PegasusTestScripts\PegasusTestScripts.csproj /testResult:E:\B2\TestResults\%NewFileName% /out:%SAVESTAMP%

echo %SAVESTAMP%

copy %SAVESTAMP% Z:\

No comments:

Post a Comment