如何生成junit测试结果的pdf报告?

时间:2016-08-17 03:38:58

标签: java maven pdf junit

I have a maven project and want to generate pdf report of my junit test results. I used Surefire and pdf plug-in as well. 
my pom looks like 
/*<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
                <configuration>
                    <archive>
                        <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
                    </archive>                  <outputDirectory>D:\backups\third\aristocrat_template_project\game-jars\queenOfTheNile_html</outputDirectory>
                </configuration>
            </plugin>         
             <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
            </plugin>        
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pdf-plugin</artifactId>
                <version>1.3</version>
                <executions>
                    <execution>
                        <id>pdf</id>
                        <phase>site</phase>
                        <goals>
                            <goal>pdf</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>  
</build>

* /
    在我的目标站点文件夹中生成html文件,但不包含与junit结果相关的报告。我还在target-&gt; pdf文件夹下获得了一个pdf文件,但它不包含任何与项目或junit结果相关的信息。谢谢!

1 个答案:

答案 0 :(得分:1)

您可以使用:How to us Maven PDF Plugin to generate PDF from Surefire Report?
你可以使用任何(至少我所知道的)测试覆盖工具(如cobertura,jacoco)并生成raports本身。
您也可以使用黄瓜测试框架来获得非常友好的报告,但这是创建黄瓜测试的一小部分。

相关问题