1

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

在此处输入图像描述

4

2 回答 2

2

这是一份 SpecFlow+Runner 报告 ( http://specflow.org/plus/runner/ )。对于 CakeBuild,我建议您通过 VSTest 和 SpecFlow+Runner 测试适配器执行测试。

因此,使用 VSTest 功能 ( http://cakebuild.net/dsl/vstest/ ) 并将 TestAdapterPath 配置到本地 NuGet 包文件夹。

因此,您会生成此报告。

于 2017-07-05T17:20:55.197 回答
2

是的,可以使用 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回答的那样,您发布的示例输出是 SpecFlow+Runner 报告。老实说,我不能说 SpecFlow 别名是否与该跑步者兼容。它仅使用默认的 SpecFlow 运行器进行了测试。

于 2017-07-05T18:39:36.530 回答