1

我正在通过一个练习来使用 specflow 构建一些集成测试,并在执行这些测试后查看一些测试结果。

我看到从 nunit 和 mstest 生成的测试结果之间的 specflow 可执行文件生成的报告质量存在一些差异。

mstest 报告似乎更符合我想要看到的内容,但是我们作为一家公司使用 nunit,因此我更喜欢使用 nunit,同时生成与我们从 mstest 看到的相同的报告。

我们从 nunit 看到的缺失报告看起来像nunit 报告

我们从 mstest 看到的更理想的报告看起来像mstest 报告

我用于 specflow 项目的配置是

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
  </configSections>
  <specFlow>

    <trace 
        traceSuccessfulSteps="true" 
        traceTimings="true" 
        minTracedDuration="0:0:0.1" 
        stepDefinitionSkeletonStyle="RegexAttribute" />
    <unitTestProvider name="nunit" /> <!-- delete as appropriate -->
    <!-- unitTestProvider name="mstest" / -->
  </specFlow>
</configuration>

我正在运行的命令行参数是:
mstest:

MSTest.exe /testcontainer:%testAssembly% /resultsfile:%resultsTrx% /detail:testname
specflow.exe mstestexecutionreport %testProject% /testresult:%resultsTrx% /out:%resultsOut%

单元:

nunit-console.exe /labels /out=%resultsTxt% /xml=%resultsXml% %testAssembly%
specflow.exe  nunitexecutionreport %testProject% /xmlTestResult:%resultsXml% /testOutput:%resultsTxt% /out:%resultsOut%

我可以做些什么来调整这些报告?

4

0 回答 0