Is it possible to get an array as a cell in cucumber parameters table?

Viewed 3789

What is the currect way to write it?

Scenario: Data tables
  Given I have the following order
    | vegetable |    array         | cost |
    | cucumber  |   1,2,3,4        |  10  |
    | carrot    |   empty array    |   6  |
    | potato    |   1,2,3          |   4  |

public class OrderItem {

    private String vegetable;
    private int[] array;
    private int cost;
}

@Given("^I have another order$")
public void i_have_another_order(List<OrderItem> list) throws Throwable {
    for (OrderItem orderItem : list) {
        // do something with my OrderItem..
    }
}
1 Answers
Related