简体   繁体   English

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

[英]How to generate pdf report of junit test results?

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>

*/ * /
In my target site folder html files are generated but does not contains the report related to junit results. 在我的目标站点文件夹中,生成了html文件,但不包含与junit结果相关的报告。 I also got a pdf file under target->pdf folder but it does not contain any information related to project or junit result. 我还在target-> pdf文件夹下得到了一个pdf文件,但是它不包含与项目或junit结果有关的任何信息。 Thanks ! 谢谢 !

You can use this: How to us Maven PDF Plugin to generate PDF from Surefire Report? 您可以使用以下方法: 如何使用Maven PDF插件从Surefire Report生成PDF?
you can use any (at least all I know) test coverage tool (like cobertura, jacoco) and will generate raports itselfes. 您可以使用任何(至少我所知道的)测试覆盖率工具(例如cobertura,jacoco),并且会生成Raports本身。
You can as well use cucumber test framework for very friendly reports, but that's a lof of effort to create cucumber tests. 您也可以使用黄瓜测试框架来生成非常友好的报告,但这是创建黄瓜测试的一项艰巨的工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM