java - io.cucumber.core.exception.CucumberException:java.lang.NoClassDefFoundError:io/cucumber/core/internal/gherkin/ast/Node
问题描述
当我使用 Run as 'JUnit Test' 运行以下代码片段时。我面临以下错误消息 PFA
import org.junit.runner.RunWith;
import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
@RunWith(Cucumber.class)
@CucumberOptions(
features= {"src/test/resources/AppFeatures"},
glue= {"stepdefinitions", "AppHooks"},
plugin= {"pretty",
"com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:",
"timeline:test-output-thread/"
} //pretty keyword used for printing purpose
)
public class MyTestRunner {
}
解决方案
你在使用 Beforeclass 和 Afterclass 钩子吗?如果是,请分享它们。
如果没有,请尝试将胶水路径更改为:
glue = "stepdefinitions"
胶水路径应该只指定步骤定义的路径。
推荐阅读
- android - Retrofit POST with empty array
- svelte - update component when progress value changes
- python - How to get user auth info in FastAPI, when using `app.add_route()` for GraphQL?
- c++ - Using a smart pointer to a struct from a C library which hides the implementation via typedef's (i.e. incomplete type)
- c++ - WriteProcessMemory fails inside function
- python - Group based on same items in list in dataframe (python)
- java - SearchView: go to another layout as enter is pressed in Android
- css - react native: creating blurred elevation (android)
- sympy - 评估 sympy 函数的解对
- python - Python 上的图形 plt.plot 不会显示