java - 无法在黄瓜报告中运行 3rd 方插件?
问题描述
我无法使用该 3rd 方插件,如果删除该插件并单击运行它运行没有错误但不生成 html 报告。我需要为 Spring Boot API 生成黄瓜报告,我添加了所有依赖项但仍然显示相同的错误,我在官方黄瓜报告页面中使用了黄瓜报告文档。
跑步者代码:
package com.example.demo.cucumberReport;
import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
import io.cucumber.spring.CucumberContextConfiguration;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(plugin={"de.monochromata.cucumber.report.PrettyReports:target/cucumber" },
features = "src/test/java/com/example/demo/cucumberReport")
@CucumberContextConfiguration
public class runTest {
}
这是跑步者文件,
POM XML:
<plugin>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>2.8.0</version>
<executions>
<execution>
<id>execution</id>
<phase>verify</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<projectName>Execution</projectName>
<outputDirectory>${project.build.directory}/cucumber-report-html</outputDirectory>
<cucumberOutput>${project.build.directory}/cucumber.json</cucumberOutput>
</configuration>
</execution>
</executions>
</plugin>
这是 pom.xml 文件
错误:
java.lang.IllegalArgumentException: The plugin specification 'de.monochromata.cucumber.report.PrettyReports:' has a problem:
Could not load plugin class 'de.monochromata.cucumber.report.PrettyReports:/target/cucumber'.
Plugin specifications should have the format of PLUGIN[:[PATH|[URI [OPTIONS]]]
Valid values for PLUGIN are: default_summary, html, json, junit, message, null_summary, pretty, progress, rerun, summary, teamcity, testng, timeline, unused, usage
PLUGIN can also be a fully qualified class name, allowing registration of 3rd party plugins. The 3rd party plugin must implement io.cucumber.plugin.Plugin
我收到此错误。
解决方案
您需要添加单色依赖项,而不是原来的 masterthought 依赖项。
<dependency>
<groupId>de.monochromata.cucumber</groupId>
<artifactId>reporting-plugin</artifactId>
<version>4.0.98</version>
</dependency>
参考:https ://gitlab.com/monochromata-de/cucumber-reporting-plugin
推荐阅读
- sql - STUFF Microsoft Access 中的语法错误
- angular - Angular 路由器导航更改 url,但不呈现组件
- r - 从数据框中选择基于特定条件的多个条目,R中有很多垃圾文本
- c# - C# 使用 LINQ 更改 ComboBox 项的选定索引
- python - 从 python 中的 CANVAS 中抓取文本
- python - 循环不会遍历列表
- ios - 无法将“颜色”类型的值分配给“UIColor”类型
- java - 如何将 LocalTime 正确格式化为 HH:MM?
- node.js - 在使用 npm 的 VS 代码方面需要帮助
- ruby - 当接收器为 nil 时,Ruby 安全导航运算符是否评估其参数?