我试图升级黄瓜以使用并行执行功能,最终导致报告门户出现问题。
在兼容性矩阵中表示:
黄瓜java和黄瓜junit的版本-4.0.0-4.2.6黄瓜代理4.0.0的测试版本
我尝试使用黄瓜剂4.0.0替换不同版本的黄瓜4.0.0、4.2.3、4.2.2、4.2.6 它说
cucumber.runtime.CucumberException:无法加载插件类: com.epam.reportportal.cucumber.ScenarioReporter。它没有实现 banana.api.Plugin
at cucumber.runtime.formatter.PluginFactory.loadClass(PluginFactory.java:176)
at cucumber.runtime.formatter.PluginFactory.pluginClass(PluginFactory.java:163)
at cucumber.runtime.formatter.PluginFactory.getPluginClass(PluginFactory.java:220)
at cucumber.runtime.formatter.PluginFactory.isStepDefinitionReporterName(PluginFactory.java:203)
at cucumber.runtime.RuntimeOptions$ParsedPluginData.addPluginName(RuntimeOptions.java:385)
at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:164)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:107)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:100)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:96)
at cucumber.runtime.RuntimeOptionsFactory.create(RuntimeOptionsFactory.java:23)
at com.github.mkolisnyk.cucumber.runner.ExtendedCucumber.<init>(ExtendedCucumber.java:49)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
POM具有以下依赖性:
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-core</artifactId>
<version>4.2.6</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>4.2.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>4.2.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-testng</artifactId>
<version>4.2.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>4.2.6</version>
<scope>test</scope>
</dependency>
<!--ReportPortal-->
<dependency>
<groupId>com.epam.reportportal</groupId>
<artifactId>agent-java-cucumber</artifactId>
<version>4.0.0</version>
</dependency>
答案 0 :(得分:2)
从Cucumber 4及更高版本开始,自定义插件需要实现Cucumber.api.event.EventListener或Cucumber.api.event.ConcurrentEventListener接口之一。其他人也可以实现cumulative.api.StepDefinitionReporter和/或cumulage.api.SummaryPrinter。这些反过来扩展了cucumber.api.Plugin接口。
您使用的插件实现了gherkin.formatter.Formatter和gherkin.formatter.Reporter接口
对此已经存在一个问题-https://github.com/reportportal/agent-java-cucumber/issues/10,并且在同一问题中给出的解决方案-https://github.com/reportportal/agent-java-cucumber/issues/10#issuecomment-438434717。
在github页面上还提到了不同黄瓜版本的兼容性表-https://github.com/reportportal/agent-java-cucumber#compatibility-matrix-for-cucumber-agents