Cucumber 没有为功能文件中的步骤提供方法签名
Cucumber is not providing the method signatures for steps in the feature file
我正在尝试填写此演示站点上的字段:http://newtours.demoaut.com/mercuryregister.php
这是我的功能文件:
Feature: Testing Mercury Tours' register page
Background:
Given the user has launched their browser
And the browser is on Mercury Tour's register page
Scenario Outline: Testing Mercury Tours' registration page via positive testing
When the user enters the "<First Name>"
And enters the "<Last Name>"
And enters the "<Phone>"
And enters the "<Email>"
And enters the "<Address>"
And enters the "<City>"
And enters the "<State>"
And enters the "<Postal Code>"
And selects the "<Country>"
And enters the "<User Name>"
And enters the "<Password>"
And enters the "<Confirm Password>"
Examples:
| First Name | Last Name | Phone | Email | Address | City | State | Postal Code | Country | User Name | Password | Confirm Password |
| Bob | Mayer | 1-877-393-4448 | BobM@example.com | 123 Victory Lane | Beverly Hills | CA | 90210 | United States | BobM | 123password | 123password |
当我 运行 这个功能文件时,Cucumber 给了我前两步的方法签名(名字和姓氏)和 Select 下拉菜单(fpr 国家)但没有其余:
@When("^the user enters the \"([^\"]*)\"$")
public void the_user_enters_the(String arg1) throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@When("^enters the \"([^\"]*)\"$")
public void enters_the(String arg1) throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@When("^selects the \"([^\"]*)\"$")
public void selects_the(String arg1) throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
如何实现方法来填充其他文本字段,例如 phone#、电子邮件和地址?
其他 "missing" 个步骤匹配相同的模式 - ^enters the \"([^\"]*)\"$
这是第二个。如果您希望 Cucumber 为每个步骤发出步骤定义方法签名,请考虑使它们独一无二。将 And enters the "<Phone>"
更改为 And enters phone details - "<Phone>"
.
我正在尝试填写此演示站点上的字段:http://newtours.demoaut.com/mercuryregister.php
这是我的功能文件:
Feature: Testing Mercury Tours' register page
Background:
Given the user has launched their browser
And the browser is on Mercury Tour's register page
Scenario Outline: Testing Mercury Tours' registration page via positive testing
When the user enters the "<First Name>"
And enters the "<Last Name>"
And enters the "<Phone>"
And enters the "<Email>"
And enters the "<Address>"
And enters the "<City>"
And enters the "<State>"
And enters the "<Postal Code>"
And selects the "<Country>"
And enters the "<User Name>"
And enters the "<Password>"
And enters the "<Confirm Password>"
Examples:
| First Name | Last Name | Phone | Email | Address | City | State | Postal Code | Country | User Name | Password | Confirm Password |
| Bob | Mayer | 1-877-393-4448 | BobM@example.com | 123 Victory Lane | Beverly Hills | CA | 90210 | United States | BobM | 123password | 123password |
当我 运行 这个功能文件时,Cucumber 给了我前两步的方法签名(名字和姓氏)和 Select 下拉菜单(fpr 国家)但没有其余:
@When("^the user enters the \"([^\"]*)\"$")
public void the_user_enters_the(String arg1) throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@When("^enters the \"([^\"]*)\"$")
public void enters_the(String arg1) throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@When("^selects the \"([^\"]*)\"$")
public void selects_the(String arg1) throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
如何实现方法来填充其他文本字段,例如 phone#、电子邮件和地址?
其他 "missing" 个步骤匹配相同的模式 - ^enters the \"([^\"]*)\"$
这是第二个。如果您希望 Cucumber 为每个步骤发出步骤定义方法签名,请考虑使它们独一无二。将 And enters the "<Phone>"
更改为 And enters phone details - "<Phone>"
.