首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >步骤未包括在报告中

步骤未包括在报告中
EN

Stack Overflow用户
提问于 2017-02-28 12:51:20
回答 1查看 172关注 0票数 1

我正在创建报告,但是没有包括步骤(请看问题末尾的截图!)

  1. 我在ClassLibrary1中创建了VS15项目
  2. 我添加了NUnit3、NUnitConsole、Specflow和Specflow.NUnit nuget包。
  3. 我增加了defaul特性和步骤定义文件。

之后,我从cmd运行这些命令(首先来自nunit文件夹,其次来自specflow文件夹):

代码语言:javascript
复制
nunit3-console.exe --labels=All --out=TestResult.txt "--result=TestResult.xml;format=nunit2" D:\Projects\ClassLibrary1\ClassLibrary1\bin\Debug\ClassLibrary1.dll

specflow.exe nunitexecutionreport D:\Projects\ClassLibrary1\ClassLibrary1\ClassLibrary1.csproj /out:MyResult.html

如我所见,步骤不包括在输出HTML文件中.我记得它在以前的版本中起作用,我看到了像“展开”这样的按钮示例,这应该有助于查看在场景中执行的准确步骤。我错过了什么?

TestResult.txt是

代码语言:javascript
复制
=> ClassLibrary1.SpecFlowFeature1Feature.AddTwoNumbers
Given I have entered 50 into the calculator
-> pending: StepDefinition1.GivenIHaveEnteredSomethingIntoTheCalculator(50)
And I have entered 70 into the calculator
-> skipped because of previous errors
When I press add
-> skipped because of previous errors
Then the result should be 120 on the screen
-> skipped because of previous errors

TestResult.xml是

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!--This file represents the results of running a test suite-->
<test-results name="D:\Projects\ClassLibrary1\ClassLibrary1\bin\Debug\ClassLibrary1.dll" total="1" errors="0" failures="0" not-run="0" inconclusive="1" ignored="0" skipped="0" invalid="0" date="2017-02-28" time="12:37:46">
  <environment nunit-version="3.5.0.0" clr-version="4.0.30319.42000" os-version="Microsoft Windows NT 10.0.14393.0" platform="Win32NT" cwd="D:\Projects\ClassLibrary1\packages\NUnit.ConsoleRunner.3.6.0\tools" machine-name="DESKTOP-417JV6U" user="dom" user-domain="DESKTOP-417JV6U" />
  <culture-info current-culture="en-US" current-uiculture="en-US" />
  <test-suite type="Assembly" name="D:\Projects\ClassLibrary1\ClassLibrary1\bin\Debug\ClassLibrary1.dll" executed="True" result="Success" success="True" time="0.386" asserts="0">
    <properties>
      <property name="_PID" value="25444" />
      <property name="_APPDOMAIN" value="domain-" />
    </properties>
    <results>
      <test-suite type="TestSuite" name="ClassLibrary1" executed="True" result="Success" success="True" time="0.379" asserts="0">
        <results>
          <test-suite type="TestFixture" name="SpecFlowFeature1Feature" description="SpecFlowFeature1" executed="True" result="Success" success="True" time="0.378" asserts="0">
            <properties>
              <property name="Description" value="SpecFlowFeature1" />
            </properties>
            <results>
              <test-case name="ClassLibrary1.SpecFlowFeature1Feature.AddTwoNumbers" description="Add two numbers" executed="True" result="Inconclusive" success="False" time="0.118" asserts="0">
                <categories>
                  <category name="mytag" />
                </categories>
                <properties>
                  <property name="Description" value="Add two numbers" />
                </properties>
                <reason>
                  <message><![CDATA[One or more step definitions are not implemented yet.
  StepDefinition1.GivenIHaveEnteredSomethingIntoTheCalculator(50)]]></message>
                </reason>
              </test-case>
            </results>
          </test-suite>
        </results>
      </test-suite>
    </results>
  </test-suite>
</test-results>

输出html如下所示:

EN

回答 1

Stack Overflow用户

发布于 2017-02-28 13:55:30

您可以通过右键单击该功能的文本并选择“生成步骤定义”来生成步骤定义。

这将生成Steps类,但它将只有抛出NotImplementedException的存根方法。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42509250

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档