目前我在我的项目中使用黄瓜进行测试。它的工作原理如下:
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(features = "classpath:features/abc.feature", tags = {"not @Ignore"})
public class ABC{
}
但是当我用
Cucumber
替换 CucumberWithSerenity
时出现错误,如下所示:
import cucumber.api.CucumberOptions;
import net.serenitybdd.cucumber.CucumberWithSerenity;
import org.junit.runner.RunWith;
@RunWith(CucumberWithSerenity.class)
@CucumberOptions(features = "classpath:features/abc.feature", tags = {"not @Ignore"})
public class ABC{
}
错误是:
java.lang.NoClassDefFoundError: io/cucumber/java/PendingException
Caused by: java.lang.ClassNotFoundException: io.cucumber.java.PendingException
我发现一些答案是因为版本冲突而出现错误。但我仍然不知道如何解决它。请帮助我!