views:

17

answers:

1

Scenario: Events should be listed in chronological order by event date in ASC order

How do i test this scenario in cucumber? Events has a name and a event_date. Events is shown in a list in the GUI. I want the test to fail when the events is in a unsorted order and the test to pass when the list is sorted by event_date ASC order.

The real problem is how to define the following step

Then /^I should see a list that has the first element "([^\"]*)"$/ do |element| ???????????????????????????????????????????????

end

A: 

create your event with like title the current date. Separate by one day. After you can check if the first element is the older event or youngest.

shingara
Then /^I should see a list that has the first element "([^\"]*)"$/ do |element|????????? end
Emil
here is real problem. How to define the step for this comparison
Emil