黄瓜步骤与多个DataTables

时间:2016-05-11 13:44:05

标签: selenium selenium-webdriver cucumber cucumber-jvm

如何编写具有两个DataTables的Cucumber步骤?

应该如何在功能文件中写入?

例如,将一行从一个表拖到第二个表的步骤:

When I drag a row from  
   | column_table1 |   
   | object1       |  
to   
   | column_table2 |   
   | object2       | 

1 个答案:

答案 0 :(得分:6)

添加第二个表没有特殊语法。只需添加它。

When I drag a row from:
| column_table1 |   
| object1       |  
And I drop it at:
| column_table2 |   
| object2       |  

AFAIK,每步只能有一个表,但您可以根据需要使用多个表。我解决问题的一种方法是将表存储在变量中,以便在第三步中经常引用:

Given I have a source row from:
<table>
And I have a destination row at:
<table>
When I drag from the source row and drop at the destimation row
Then .....
相关问题