Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cucumber step with multiple DataTables

How can I write a Cucumber step that has two DataTables?

How it should be written in the feature file?

For example , a step to drag a row from one table to second table:

When I drag a row from  
   | column_table1 |   
   | object1       |  
to   
   | column_table2 |   
   | object2       | 
like image 647
Avi Rosenfeld Avatar asked May 11 '16 13:05

Avi Rosenfeld


1 Answers

There is no special syntax to add a second table. Just add it.

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

AFAIK, you can only have one table per step, but you can have as many steps with tables as you want. One way I approach the problem is storing the tables in a variable to often reference in a third step:

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 .....
like image 69
Jeff Price Avatar answered Sep 24 '22 03:09

Jeff Price