我是黄瓜新手,在运行特定黄瓜场景时遇到奇怪的问题。 下面是我在我的功能文件中定义的两个场景。 第一场景没有任何问题,但黄瓜在运行测试用例时甚至不考虑第二场景。运行黄瓜场景时遇到问题
Scenario Outline:
1.Validate create functionality
Given user is on "Home" screen
When click on Create
Then create screen should render
Scenario Outline:
2.Validate create Name,Description,Start Date
Given user is on create screen
When user enters following values:
| Name | dummyName |
| Desc | [email protected]# |
| Date | ghgh |
Then there should be error message on the screen.
下面是在Java功能的实现方法
方案1.
@Given("^user is on \"([^\"]*)\" screen$")
public void homeScreen(String home) throws Throwable {
//someCode
}
@When("^click on Create$")
public clickCreate() throws Throwable {
//someCode
}
@Then ("^create screen should render$")
public void createRender() throws Throwable {
//someCode
}
场景2.
@Given("^user is on create screen$")
public void crateScreen() throws Throwable {
//someCode
}
@When("^user enters following values :$")
public void EnterValues(Map<String,String> map) throws Throwable {
//someCode
}
@Then("^there should be error message on the screen.$")
public void errorMessage() throws Throwable {
//someCode
}
为什么方案不被调用的黄瓜?
环境 - 黄瓜,硒,JAVA
你的错误是什么? – bcar 2014-11-08 16:40:50
感谢您的回复,但它没有显示任何错误,但情况2没有得到执行。 – Gautam 2014-11-08 17:04:19
你的跑步者在哪里? – 2017-12-11 02:18:31