windowscmdbddspecflowspecrun

Execute mutliple feature files in a project using specrun


Is there any way to execute multiple feature files within a project using specrun.exe

eg: I have a project Student, and I have the below feature files:

a.Maths
b.Biology
C.Chemistry
d.Physics.

Now I need to execute Maths and Physics together. How to do it?

For single feature file (Eg:Maths) the below command is working fine.

@pushd %~dp0

%windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe "Student.csproj"

@if ERRORLEVEL 1 goto end

@cd ..\packages\SpecRun.Runner.*\tools

@set profile=%1
@if "%profile%" == "" set profile=Default

SpecRun.exe run %~dp0\%profile%.srprofile "/baseFolder:%~dp0\bin\Debug" /log:specrun.log %2 /filter:testpath:Feature:Maths %4 %5

:end

@popd

Solution

  • Finally, I got the answer.

    we have to exclude the feature files which we don't want to run.

    The command that worked fine for me is as below

    SpecRun.exe run %~dp0\%profile%.srprofile "/baseFolder:%~dp0\bin\Debug" /log:specrun.log "/filter:!testpath:Feature:Biology& !testpath:Feature:Chemistry"