我正在使用Cucumber4并执行以下类来执行我的方案。我可以在单独执行文件的同时执行自己的方案。但是无法由亚军级别的运动员执行。我也尝试了mvn clean verify命令并得到同样的错误。
import io.cucumber.junit.CucumberOptions;
import net.serenitybdd.cucumber.CucumberWithSerenity;
import org.junit.runner.RunWith;
@RunWith(CucumberWithSerenity.class)
@CucumberOptions(
plugin = {"pretty"},
features = "src/test/resources/features"
)
public class CucumberTestSuite {}
执行它时,出现以下错误
CucumberTestSuitejava.lang.NoClassDefFoundError: io/cucumber/java/PendingException
at net.thucydides.core.model.failures.FailureAnalysis.<clinit>(FailureAnalysis.java:74)
at net.thucydides.core.steps.BaseStepListener.<init>(BaseStepListener.java:727)
at net.thucydides.core.steps.BaseStepListener.<init>(BaseStepListener.java:271)
at net.thucydides.core.steps.Listeners$BaseStepListenerBuilder.withOutputDirectory(Listeners.java:37)
at net.serenitybdd.core.SerenityListeners.<init>(SerenityListeners.java:30)
at cucumber.runtime.formatter.SerenityReporter.initialiseListenersFor(SerenityReporter.java:112)
at cucumber.runtime.formatter.SerenityReporter.lambda$handleTestSourceRead$0(SerenityReporter.java:149)
at java.base/java.util.Optional.ifPresent(Optional.java:176)
at cucumber.runtime.formatter.SerenityReporter.handleTestSourceRead(SerenityReporter.java:144)
at cucumber.runner.AbstractEventPublisher.send(AbstractEventPublisher.java:45)
at cucumber.runner.AbstractEventBus.send(AbstractEventBus.java:9)
at cucumber.runner.TimeServiceEventBus.send(TimeServiceEventBus.java:3)
at cucumber.runtime.model.CucumberFeature.sendTestSourceRead(CucumberFeature.java:44)
at io.cucumber.junit.CucumberSerenityRunner$RunCucumber.evaluate(CucumberSerenityRunner.java:234)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:410)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.ClassNotFoundException: io.cucumber.java.PendingException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 24 more