我喜欢 testng xslt 报告的图形表示,我想通过电子邮件发送(不确定是否可能,因为它发送 HTML)。我试过这个博客。下面的 pom.xml 没有给出任何错误,但仍然无法C:/Users/windowspc/workspace/windows-project/target/testng-xslt-report
使用 xslt 报告创建目录。我记得我能够通过 build.xml 生成 xslt 报告,我记得我已经给出了saxon.jar
所以我也在 pom 中添加了依赖项,它也有这段代码<xslt in="${basedir}/test-output/testng-results.xml" style="${basedir}/testng-results.xsl" out="${basedir}/testng-xslt/index.html">
但它在 pom.xml 中丢失了,我不确定在哪里如果需要生成 xslt 报告,请添加此内容。
pom 看起来像这样:
<build>
<testResources>
<testResource>
<directory>src/test/resource</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</testResource>
</testResources>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>
C:/Users/windowspc/workspace/windows-project/Chrome.xml
</suiteXmlFile>
</suiteXmlFiles>
<testFailureIgnore>
true
</testFailureIgnore>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.testng.xslt</groupId>
<artifactId>testng-xslt-plugin</artifactId>
<version>1.1</version>
<configuration>
<outputDir>C:/Users/windowspc/workspace/windows-project/target/testng-xslt-report</outputDir>
<showRuntimeTotals>true</showRuntimeTotals>
<sortTestCaseLinks>true</sortTestCaseLinks>
<testDetailsFilter>FAIL,PASS,SKIP,CONF</testDetailsFilter>
</configuration>
</plugin>
</plugins>
</reporting>
<pluginRepositories>
<pluginRepository>
<id>testng-xslt-plugin</id>
<url>http://uhftopic.com/maven/</url>
</pluginRepository>
</pluginRepositories>
...
...
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.12</version>
</dependency>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>saxon</artifactId>
<version>8.7</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.5.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>