Java 黄瓜和羔羊步防御
我已尝试获取某个功能的步骤。当我运行功能文件时,它会给我 差不多Java 黄瓜和羔羊步防御,java,selenium,Java,Selenium,我已尝试获取某个功能的步骤。当我运行功能文件时,它会给我 差不多 Given("^I want to register into the main forum$", () -> { // Write code here that turns the phrase above into concrete actions throw new PendingException(); }); 这是一个lambda函数 我以前把它看作是一门课,如下所示 Class StepDefi
Given("^I want to register into the main forum$", () -> {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
});
这是一个lambda函数
我以前把它看作是一门课,如下所示
Class StepDefinition{
@Given("^I want to register into the main forum$")
public void given(){
}
}
但是我想知道如何使用这个lambda?我找到了答案
public void given(){
Given("^I want to register into the main forum$", () -> {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
});
}
然后将STS的java版本设置为
java8
,您可以通过提供用户名密码并单击“登录”来为代码设置登录主论坛的权限。