我在运行这个黄瓜项目下面有问题。这显示在7号线,8,20和32在日食中用bdd运行黄瓜
package stepDefinition;
import cucumber.api.java.en.Given;
public class aptitudeTest {
@Given ("I have successfully ([^\"]*)")
public void I have (String str)
{
if (str.equals("registered"))
{
System.out.println("registered Automation");
}
{
System.out.println("unregistered Automation");
}
}
@When ("I enter my valid ([^\"]*)")
public void I enter (String str)
{
if (str.equals("credentials"))
{
System.out.println("credentials Automation");
}
{
System.out.println("details Automation");
}
}
@Then ("I should see the welcome ([^\"]*) him")
public void I should (String str)
{
if (str.equals("welcome"))
{
System.out.println("welcome to your account");
}
{
System.out.println("please enter the correct credential");
}
}
}
下面的错误是Feature文件
Scenario:I should see a message when i successfully logged in
Given I have successfully registered
When I enter my valid credentials
Then I should see the welcome message
我的意思是没有不敬,但你最好的一步是采取一个介绍性的java类。 –
你应该看看你是如何命名的方法?名称不能有空格。 https://docs.oracle.com/javase/tutorial/java/nutsandbolts/variables.html#naming – Grasshopper