java - 黄瓜定制插件
问题描述
如何在测试运行器中指定定制的黄瓜插件?
我收到以下错误
java.lang.IllegalArgumentException: The plugin specification 'UD.Plugin' has a problem:
Could not load plugin class 'UD.Plugin'.
Plugin specifications should have the format of PLUGIN[:[PATH|[URI [OPTIONS]]]
预期的格式是什么,
如果我的插件位于 Src/main/UD 并且运行器位于 Src/Test/TestRunner
注意:我用的是黄瓜 4
解决方案
提到
cucumber.plugin = com.test.support.ReportPlugin
在junit-platform.properties
我的插件文件在src/test/java/com.test.support
并且属性文件在
src/test/resources/junit-platform.properties
我相关的 pom 配置是
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>6.9.1</version>
<scope>test</scope>
</dependency>
插件文件看起来像这样
package com.test.support;
import io.cucumber.plugin.EventListener;
import io.cucumber.plugin.event.*;
import java.net.URI;
import java.util.Map;
import java.util.TreeMap;
import java.util.UUID;
public class ReportPlugin implements EventListener {
....
....
推荐阅读
- angular - 使用自定义模块应用primeng
- python - 使用 Python 捕获 HTML 文本的正则表达式
- php - 没有警报消息,Ajax 成功不起作用
- redis - 我可以为 redis zset 定义自定义比较函数吗?
- java - 动态(重新)加载服务提供者模块
- d3.js - 在应用过渡之前停止绘制第一条路径的正确方法是什么?
- python - 如何使用 Python 从 Google 表格中获取特定的单元格值以用于不和谐机器人?
- python - 如何从python中的字符串中删除多次出现?
- python - 如何在网格搜索后绘制热图并找到决策树的最佳超参数
- google-forms - 提交 Google 表单后显示图片