gpt4 book ai didi

java - RunnerClass 找不到步骤?

转载 作者:行者123 更新时间:2023-12-01 20:26:28 25 4
gpt4 key购买 nike

为什么我的运行者类找不到我的步骤文件?

我创建了两个具有独特方法等的功能文件,如果我一一执行它们,它们能够找到相关步骤,但在执行主运行器类时不起作用?

@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 {

}

enter image description here

最佳答案

我相信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"}
)

关于java - RunnerClass 找不到步骤?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43835155/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com