2017-08-08 90 views
1

下面我有一个Junit的HTML报告在我的地方它是通过ANT建:如何通过电子邮件发送的JUnit报告报告不会显示

现在我遇到的问题是,如果我尝试这个连接报告只需发送index.html,它会显示:

我想知道如何通过电子邮件发送上述报告,以便每个人都可以看到html报告。我只想发送index.html我不想给大家发送相应的文件。

XML代码来构建这个报告是低于(我的xxx了一些东西并不是在真正的文件XXX):

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<!-- WARNING: Eclipse auto generated file. 
      Any modifications will be overwritten. 
      To include a user specific buildfile here, simply create one in the same 
      directory with the processing instruction <?eclipse.ant.import?> 
      as the first entry and export the buildfile again. --> 

<project basedir="." default="Test_Report" name="Test_Report"> 


<target name="xxx_SoapUI"> 
<exec dir="." executable="C:\Program Files\SmartBear\SoapUI-5.3.0\bin\testrunner.bat"> 
<arg line="-r -j -f 'D:\xxx\xxx' 'D:\xxx).xml'"></arg> 
</exec> 
</target> 

    <target name="xxx_SoapUI"> 
<exec dir="." executable="C:\Program Files\SmartBear\SoapUI-5.3.0\bin\testrunner.bat"> 
<arg line="-r -j -f 'D:\xxx\xxx' 'D:\xxx).xml'"></arg> 
</exec> 
</target> 

    <target name="xxx_SoapUI"> 
<exec dir="." executable="C:\Program Files\SmartBear\SoapUI-5.3.0\bin\testrunner.bat"> 
<arg line="-r -j -f 'D:\xxx\xxx' 'D:\xxx).xml'"></arg> 
</exec> 
</target> 


</project> 
+1

'testrunner.bat'必须在你的'路径'中。是吗? – Magoo

+0

您是否检查过解决方案? – Rao

+0

这两个解决方案都很好,我最终使用了noframes方法,所以标记为最佳答案,但两个答案都可以工作。非常感谢你 – BruceyBandit

回答

1

format="frames"属性通常生成单独的文件为框架,也许样式表。正如task documentation提到的,你可以将该值设置为noframes和Ant将在一个HTML生成报告:

noframes格式不使用重定向,并生成一个文件名为junit-noframes.html

如果你需要定制用于生成报告的XSL,你可以使用styledir属性来覆盖它(请注意该文件必须命名为junit-noframes.xsl)。默认的XSL嵌入在Ant源代码中,可以查看here

0

这是另一种方法。

在这种方法中,不要使用任何附件的测试结果。相反,将结果托管在诸如tomcat或WebDAV的容器中。

这里是为Tomcat的例子(应该是类似的WebDAV,以及东西):

  • 安装Tomcat
  • 创建一个目录说TOMCAT_HOME \ webapps目录下reports,并确保在Tomcat启动。
  • 使用当前蚂蚁目标生成报告后,创建新的目标移动当前报告TOMCAT_HOME\webapps\reports\<timestamp>
  • 在电子邮件中发送报告链接。报告链接可能是http://<hostname>:<port>/reports/<timestamp>/index.html

这样,每个人都可以在线访问报告。

相关问题