0

我喜欢 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>
4

1 回答 1

0

插件存储库处于脱机状态。尝试从其他地方下载此插件。

博客评论中有一个答案:

请在下面找到 testngxslt jar 的下载链接: https ://docs.google.com/open?id=0B3OQaZlrVrdJRndLZWhrcDBzaFU

您可以使用以下链接中提到的任何以下方法将其包含在您的类路径中: Maven:如何将代表中不可用的 jar 包含到 J2EE 项目中?

http://www.roseindia.net/answers/viewqa/Maven/11659-include-jar-file-in-maven-pom.xml-.html

于 2013-09-23T13:21:11.663 回答