使用 SpecFlow 创建 html 测试报告的最佳方法是什么?

What is the best way to create an html test report using SpecFlow?

我在 运行2015 年 Visual Studio 正在做 tdd 报告。

据我所读,我应该能够使用 specflow 命令行工具生成 html 报告

specflow.exe mstestexecutionreport "Visual Studio 2015\Projects\blahSpec.csproj" /out:MyResult.html

这反过来抱怨找不到 .trx 类型的文件。

NConsoler.NConsolerException: Could not find file 'C:\Visual Studio 
2015\Projects\blahSpec\packages\SpecFlow.2.2.0\tools\TestResult.trx'. 

这让我相信我需要设置 MsTest 以在我 运行 测试时生成一个 .trx 文件。我阅读的文档并不特定于我想要测试的内容 (https://social.msdn.microsoft.com/Forums/azure/en-US/7577a33c-84bc-4144-b45f-76c8e03b0a8e/create-a-trx-file-whenever-any-tests-are-executed-from-test-explorer?forum=vsunittest) 它谈到了一个我找不到的设置文件,而且我找不到任何关于如何创建一个的信息。

这次涉足高大的杂草让我觉得我的做法是错误的,应该在这里寻求帮助。

与此同时 Ruby...

SpecFlow 的 ruby 等价物:Cucumber,有一个格式标志,允许用户将输出生成为可以呈现给更高层的漂亮 HTML 格式。

cucumber --format html -o blah.html

在 VS2015 中执行此操作的最佳方法是什么?我是关闭还是我以错误的方式处理它?

我正在使用 Specflow 和 Selenium Webdriver

因此,对于那些使用 SpecFlow 和 Selenium 来测试其基于 Web 的应用程序并希望将报告格式化为 HTML 格式的人来说

  1. 导航到 ..\Projects[项目名称]..\bin\Debug
  2. 运行 MSTEST 生成 .trx 文件

    mstest /testcontainer:[projectname].dll /ResultsFile:TestResult.trx

  3. 最后从..[项目名称]\packages\SpecFlow.[版本号]\tools,运行SpecFlow命令行工具抓取.trx文件并生成报告。

    specflow.exe mstestexecutionreport "C:\Users\blah\Documents\Visual Studio 2015\Projects\MyProject\MyProject\MyProject.csproj" /out:MyResult.html /testresult:TestResult.trx

  4. 查看文件并庆祝