可以使用CakeBuild Specflow插件生成SpecFlow报告吗? [英] Generating SpecFlow Reports with the CakeBuild Specflow plugin possible?
问题描述
是否可以使用CakeBuild Specflow插件(
是的,可以使用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,
新的NUnit3Settings {
结果= /path/to/testresults.xml,
ResultFormat = nunit2,
标签= NUnit3Labels.All,
OutputFile = /path/to/testoutput.txt
});
}, /path/to/your/test/project.csproj ,
新的SpecFlowTestExecutionReportSettings {
Out = /path/to/specflow/execution/report.html\"、
XsltFile = /path/to/optional/transform/file.xslt
});
});
RunTarget(target);
但是作为Andreas Willich 已回答,您发布的示例输出是SpecFlow + Runner报告。老实说,我不能说SpecFlow别名是否与该运行程序兼容。仅使用默认的SpecFlow运行器进行了测试。
Is it possible to generate SpecFlow Reports with the CakeBuild Specflow plugin (CakeBuild SpecFlow) ?
Yes it's possible to create Test Execution report with Cake build. Here's a quick example using NUnit3 as test runner (other supported runners are MSTest, XUnit and 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);
But as Andreas Willich answered, the example output you posted is a SpecFlow+Runner report. Honestly I can't say if the SpecFlow aliases are compatible with that runner. It's only tested with the default SpecFlow runner.
这篇关于可以使用CakeBuild Specflow插件生成SpecFlow报告吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!