嗨,我在使用intellij和黄瓜运行验收测试用例时遇到以下错误。让我知道您是否需要更多详细信息。
cucumber.runtime.CucumberException:无法加载插件类:null
at cucumber.runtime.formatter.PluginFactory.loadClass(PluginFactory.java:180)
at cucumber.runtime.formatter.PluginFactory.pluginClass(PluginFactory.java:165)
at cucumber.runtime.formatter.PluginFactory.getPluginClass(PluginFactory.java:222)
at cucumber.runtime.formatter.PluginFactory.isFormatterName(PluginFactory.java:200)
at cucumber.runtime.RuntimeOptions$ParsedPluginData.addPluginName(RuntimeOptions.java:365)
at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:125)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:85)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:78)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:70)
at cucumber.runtime.RuntimeOptionsFactory.create(RuntimeOptionsFactory.java:25)
at cucumber.api.junit.Cucumber.<init>(Cucumber.java:56)
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)
Caused by: java.lang.ClassNotFoundException: null
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at cucumber.runtime.formatter.PluginFactory.loadClass(PluginFactory.java:173)
... 24 more
这是我的build.gradle文件配置
testCompile('io.cucumber:cucumber-java8:4.7.1')
compile "io.springfox:springfox-swagger2:2.9.2"
compile "io.springfox:springfox-swagger-ui:2.9.2"
//added power mock
testCompile "org.springframework.boot:spring-boot-starter-test"
testCompile group: 'info.cukes', name: 'cucumber-junit', version: '1.2.5'
testImplementation("io.cucumber:cucumber-spring:${cucumberSpringVersion}")
testImplementation("io.cucumber:cucumber-junit:4.7.1")
testImplementation("io.cucumber:cucumber-java8:4.7.1")
runtimeOnly 'com.h2database:h2'
任务黄瓜(取决于:“:qa:黄瓜”){
}
这是我的跑步者班:
import io.cucumber.junit.CucumberOptions;
import org.junit.runner.RunWith;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(plugin =
{"pretty", "html:output", "json:output/cucumber.json" },
features = { "src/test/resources/features/generic/healthcheck" },
glue = { "com.xxx.yyy.at.platform.steps" })
public class TestRunner {
}