为什么我的跑步者课程没有找到我的步骤文件?
我创建了两个具有独特方法的特征文件等,如果我逐个执行它们,它们能够找到相关的步骤,但dosnt在执行主流道类时有效吗?
@RunWith(Cucumber.class)
@CucumberOptions (
features = {"src/test/java/CucumberFramework/featureFiles/"},
glue = {"src/test/java/CucumberFramework/steps"},
monochrome = true,
tags = {},
plugin = {"pretty", "html:target/cucumber", "json:target/cucumber.json", "com.cucumber.listener.ExtentCucumberFormatter:target/report.html"}
)
public class MainRunner {
}
答案 0 :(得分:3)
我相信glue
采用包名,而不是路径。所以你想要:
@CucumberOptions (
features = {"src/test/java/CucumberFramework/featureFiles/"},
glue = {"CucumberFramework.steps"}, // < I changed this
monochrome = true,
tags = {},
plugin = {"pretty", "html:target/cucumber", "json:target/cucumber.json", "com.cucumber.listener.ExtentCucumberFormatter:target/report.html"}
)