【发布时间】:2020-08-09 06:03:42
【问题描述】:
在 Eclipse 中检查 Cucumber 时,我尝试运行具有以下条目的 Junit 类:
@RunWith(Cucumber.class)
public class JCuc {
}
随附的 Java 主类也有以下条目
public class LoginStep {
@Given("^the url is present$")
public void the_url() throws Throwable {
}
@Given("^the website is loaded$")
public void the_website_is_loaded() throws Throwable {
}
@When("^Enter valid user name$")
public void enter_valid_user_name() throws Throwable {
}
@When("^Enter valid password$")
public void enter_valid_password() throws Throwable {
}
@Then("^I validate signin$")
public void i_validate_signin() throws Throwable {
}
}
使用 Junit 4 运行时出现以下错误 Error screenprint
以上在 Eclipse Neon 上运行良好 但我在 Eclipse 2020-03 (4.15) 中遇到错误 任何人都可以帮助解决这个问题
【问题讨论】:
-
查看工作区.metadata目录下的.log文件,看看是否有更详细的消息。 Edit您的问题向我们展示更多细节。
-
如上面cmets所说,你的代码没有问题。检查工作区中的 .log 文件以了解详细错误。主要是因为 Eclipse 本身的错误配置插件或错误。
-
感谢您的建议,我在下面添加了日志条目,你们能检查一下并告诉我它是什么吗?
标签: java eclipse junit nullpointerexception cucumber