使用 specrun 在一个项目中执行多个特征文件

Execute mutliple feature files in a project using specrun

有什么方法可以使用 specrun.exe

在一个项目中执行多个功能文件

例如:我有一个学生项目,我有以下功能文件:

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

现在我需要一起学习数学和物理。怎么做?

对于单个特征文件(例如:数学),以下命令运行良好。

@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

终于找到答案了

我们必须排除不想要的功能文件 运行。

对我来说效果很好的命令如下

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