【cucumber】cluecumber-report-plugin生成测试报告

cluecumber为生成测试报告的第三方插件,可以生成html测报,该测报生成需以本地json测报的生成为基础。

所以需要在测试开始主文件标签@CucumberOptions中,写入生成json报告。

  1. pom xml文件中加入插件
XML 复制代码
<!-- 根据 cucumber json文件 美化测试报告插件-->
        <dependency>
            <groupId>com.trivago.rta</groupId>
            <artifactId>cluecumber-report-plugin</artifactId>
            <version>2.7.0</version>
        </dependency>
  1. pom xml文件bulid配置
XML 复制代码
<build>
        <plugins>
            <plugin>
                <groupId>com.trivago.rta</groupId>
                <artifactId>cluecumber-report-plugin</artifactId>
                <version>2.5.0</version>
                <configuration>
                    <!-- json报告目录 -->
                    <sourceJsonReportDirectory>F:\JavaProject\java-lesson\target\json-report</sourceJsonReportDirectory>
                    <!-- 美化后报告目录 -->
                    <generatedHtmlReportDirectory>F:\JavaProject\java-lesson\target\cluecumber-report\</generatedHtmlReportDirectory>
                    <!-- html报告title -->
                    <customPageTitle>Testing report</customPageTitle>
                </configuration>
            </plugin>
        </plugins>
    </build>
  1. Terminal运行命令:mvn cluecumber-report:reporting

会在指定目录下生成文件

最后运行测试,得到测试报告。

相关推荐
win x41 分钟前
Redis 使用~如何在Java中连接使用redis
java·数据库·redis
星晨雪海1 小时前
基于 @Resource 的支付 Service 多实现类完整示例
java·开发语言
阿维的博客日记1 小时前
什么是逃逸分析
java·juc
Ricky_Theseus1 小时前
C++右值引用
java·开发语言·c++
Rick19932 小时前
Java内存参数解析
java·开发语言·jvm
我是大猴子2 小时前
Spring代理类为何依赖注入失效?
java·后端·spring
勿忘,瞬间2 小时前
多线程之进阶修炼
java·开发语言
014-code2 小时前
线程池参数怎么配才不翻车
java
吴梓穆2 小时前
UE5 c++ 常用方法
java·c++·ue5
王夏奇2 小时前
python中的__all__ 具体用法
java·前端·python