【发布时间】:2013-02-08 23:23:05
【问题描述】:
我正在使用cucumber-jvm。我在 .feature 文件中有以下内容:
Background:
Given the following account file line:
| First Name | Lance |
| Last Name | Fisher |
| Corporate Name | |
这是一个垂直方向的表格。以下生成的步骤定义使用 First Name 和 Lance 作为标题,其中 First Name、Last Name 和 Corporate Name 应该是标题。
@Given("^the following account file line:$")
public void the_following_account_file_line(DataTable arg1) throws Throwable {
// Express the Regexp above with the code you wish you had
// For automatic conversion, change DataTable to List<YourType>
throw new PendingException();
}
如何实现步骤定义来处理垂直表而不是水平表?
【问题讨论】:
-
垂直化的原因是什么?表格的好处是它允许以表格格式简洁地处理多个测试用例。通过限制处理的测试用例数量,垂直化消除了这种好处。
-
我的标题比记录多,因此无需向右滚动就可以将它们放在我的屏幕上。
标签: cucumber gherkin cucumber-jvm