【发布时间】:2021-03-11 04:01:24
【问题描述】:
我问是否有任何方法可以将大纲场景和数据表结合起来,如下例所示:
Feature: User Sign UP
Scenario Outline: User <User> tries to signup with improper combination of password
Given the user <User> has browsed to the signup page
When the user <User> tries to signup entering the following details
| email | <Email> |
| password | <Password> |
| confirmPassword | <ConfirmPassword> |
Then an error message <validation> should be shown above the password field
Examples:
| User | Email |Password | ConfirmPassword | validation |
| user1 | email1@gmail.com | 234567569 | 234567569 | This password is entirely numeric. |
| user2 | email2@gmail.com | 123456789 | 123456789 | This password is too common. |
Java 步骤类:
@When("the user (.+) tries to signup entering the following details")
public void testAdd2(String user,DataTable dataTable) throws Throwable {
//Asserts
}
感谢您的宝贵时间。
【问题讨论】:
-
应该可以 - 检查stackoverflow.com/a/44198697/2235381
标签: java cucumber outline scenarios