首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何生成junit测试结果的pdf报告?

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

Stack Overflow用户
提问于 2016-08-17 03:38:58
回答 1查看 4.8K关注 0票数 1
代码语言:javascript
运行
复制
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>

*/

代码语言:javascript
运行
复制
 In my target site folder html files are generated but does not contains the report related to junit results. I also got a pdf file under target->pdf folder but it does not contain any information related to project or junit result. Thanks !
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-08-17 06:50:45

您可以使用这个:How to us Maven PDF Plugin to generate PDF from Surefire Report?

您可以使用任何(至少我所知道的)测试覆盖工具(如cobertura,jacoco),并将生成raports自身。

对于非常友好的报告,您也可以使用黄瓜测试框架,但这是创建黄瓜测试的一项努力。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38987727

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档