是否可以使用CakeBuild SpecFlow插件(CakeBuild SpecFlow)生成Specflow报告?

发布于 2017-07-06 02:39:37
是的,可以使用Cake build创建测试执行报告。这里有一个使用NUnit3作为测试运行器的快速示例(其他受支持的运行器是MSTest、XUnit和NUnit2)。
#tool "nuget:?package=NUnit.ConsoleRunner"
#tool "nuget:?package=SpecFlow"
var target = Argument("target", "Default");
Task("Default")
.Does(() =>
{
SpecFlowTestExecutionReport(tool => {
tool.NUnit3("/path/to/your/tests.dll",
new NUnit3Settings {
Results = "/path/to/testresults.xml",
ResultFormat = "nunit2",
Labels = NUnit3Labels.All,
OutputFile = "/path/to/testoutput.txt"
});
}, "/path/to/your/test/project.csproj",
new SpecFlowTestExecutionReportSettings {
Out = "/path/to/specflow/execution/report.html",
XsltFile = "/path/to/optional/transform/file.xslt"
});
});
RunTarget(target);但是作为Andreas Willich answered,您发布的示例输出是一个SpecFlow+Runner报告。老实说,我不能说SpecFlow别名是否与那个runner兼容。它只使用默认的SpecFlow运行器进行测试。
发布于 2017-07-06 01:20:55
这是一份SpecFlow+Runner报告(http://specflow.org/plus/runner/)。对于CakeBuild,我建议您通过VSTest和SpecFlow+Runner测试适配器执行测试。
因此,使用VSTest功能(http://cakebuild.net/dsl/vstest/)并将TestAdapterPath配置到本地NuGet包文件夹。
因此,您可以生成此报告。
https://stackoverflow.com/questions/44930074
复制相似问题