【问题标题】:JUnit HTML report (index.html) is not generated in the JUNIT folder, If I run the test case through ANT in eclipseJUNIT 文件夹中未生成 JUnit HTML 报告(index.html),如果我在 Eclipse 中通过 ANT 运行测试用例
【发布时间】:2015-12-20 11:54:29
【问题描述】:

我在eclipse中通过ANT运行JUnit测试用例,构建成功,但是JUnit文件夹中没有生成测试用例的JUnit Html报告(index.html)。

以下是版本:

蚂蚁:apache-ant-1.9.4 JUnit:junit 4.11 jar 文件 Eclipse:版本:3.7.2

请帮忙!

【问题讨论】:

  • 请编辑您的问题并添加带有<junit> 的Ant 脚本。

标签: java eclipse ant selenium-webdriver junit


【解决方案1】:

我假设您正在使用 ant junit 任务来运行测试用例。但是,要生成 HTML 报告,您需要添加 junit 报告任务。请看上面的例子

<target name="test-html">
  <junit fork="yes" printsummary="no" haltonfailure="no">
    <batchtest fork="yes" todir="${test.reports}" >
      <fileset dir="${classes}">
        <include name="**/*Test.class" />
      </fileset>
    </batchtest>
    <formatter type="xml" />
    <classpath refid="test.classpath" />
  </junit>

  <junitreport todir="${test.reports}">
    <fileset dir="${test.reports}">
      <include name="TEST-*.xml" />
    </fileset>
    <report todir="${test.reports}" />
  </junitreport>
</target>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-26
    • 2017-05-19
    • 1970-01-01
    • 1970-01-01
    • 2013-06-25
    相关资源
    最近更新 更多