dox Executable Documentation

Make selection

After deadline

Given now is '2000-01-01 18:00:01'
Given the order 'Test Order' with deadline '2000-01-01 18:00'
When I open the page for order 'Test Order'
Then I should be redirected to 'selection.html?order=1'

No selection

Given now is '1999-12-30 15:38'
Given I am logged as the user 'Bart'
Given an order 'Test Order' with deadline and '2000-01-01 18:00' menus each 2 dishes starting on 2 '2000-01-03'
Given dish 1 of menu 1 of this order is 'A'
Given dish 2 of menu 1 of this order is 'B'
Given dish 1 of menu 2 of this order is 'C'
Given dish 2 of menu 2 of this order is 'D'
When I open the page for order 'Test Order'
Then there should be no error message
Then there should be no success message
Then the order 'Test Order' should be loaded
Then the displayed time left should be '2d 2h 22m'
Then there should be 2 menus
Then the date of menu 1 should be 'Monday, 3.1.2000'
Then the none option of menu 1 should not be checked
Then dish 1 of menu 1 should not be checked
Then dish 2 of menu 1 should not be checked
Then menu 1 should have 2 dishes
Then dish 1 of menu 1 should be 'A'
Then dish 2 of menu 1 should be 'B'
Then the date of menu 2 should be 'Tuesday, 4.1.2000'

Create selection

Given I am logged as the user 'Bart'
Given an order 'Test Order' with 3 menus each 2 dishes
Given dish 1 of menu 1 of this order is 'A'
Given dish 2 of menu 1 of this order is 'B'
Given dish 1 of menu 2 of this order is 'C'
Given dish 2 of menu 2 of this order is 'D'
Given dish 1 of menu 3 of this order is 'E'
Given dish 2 of menu 3 of this order is 'F'
Given I have opened the page for order 'Test Order'
Given I selected dish 'A' of menu 1
Given I selected dish 'D' of menu 2
Given I selected no dish of menu 3
When I save my selections
Then there should be 3 selections
Then there should be a selection with menu 1 of order 'Test Order' and dish 'A' for user 'Bart'
Then there should be a selection with menu 2 of order 'Test Order' and dish 'D' for user 'Bart'
Then there should be a selection with menu 3 of order 'Test Order' and no dish for user 'Bart'
Then the success message should be 'Selection saved'

Load selections

Given I am logged as the user 'Bart'
Given now is '2000-01-01 17:59'
Given an order 'Test Order' with deadline and '2000-01-01 18:00' menus each 3 dishes starting on 2 '2000-01-03'
Given dish 1 of menu 1 of this order is 'A'
Given dish 2 of menu 1 of this order is 'B'
Given dish 1 of menu 2 of this order is 'C'
Given dish 2 of menu 2 of this order is 'D'
Given dish 1 of menu 3 of this order is 'E'
Given dish 2 of menu 3 of this order is 'F'
Given 'Bart' selected no dish for menu 1 of order 'Test Order'
Given 'Bart' selected dish 'C' for menu 2 of order 'Test Order'
When I open the page for order 'Test Order'
Then there should be 3 menus
Then menu 1 should have 2 dishes
Then the none option of menu 1 should be checked
Then dish 1 of menu 1 should not be checked
Then dish 2 of menu 1 should not be checked
Then menu 2 should have 2 dishes
Then the none option of menu 2 should not be checked
Then dish 1 of menu 2 should be checked
Then dish 2 of menu 2 should not be checked
Then menu 3 should have 2 dishes
Then the none option of menu 3 should not be checked
Then dish 1 of menu 3 should not be checked
Then dish 2 of menu 3 should not be checked

Update selections

Given I am logged as the user 'Bart'
Given now is '2000-01-01 17:59'
Given an order 'Test Order' with deadline and '2000-01-01 18:00' menus each 3 dishes starting on 2 '2000-01-03'
Given dish 1 of menu 1 of this order is 'A'
Given dish 2 of menu 1 of this order is 'B'
Given dish 1 of menu 2 of this order is 'C'
Given dish 2 of menu 2 of this order is 'D'
Given dish 1 of menu 3 of this order is 'E'
Given dish 2 of menu 3 of this order is 'F'
Given 'Bart' selected dish 'A' for menu 1 of order 'Test Order'
Given 'Bart' selected dish 'C' for menu 2 of order 'Test Order'
Given 'Bart' selected no dish for menu 3 of order 'Test Order'
Given I have opened the page for order 'Test Order'
Given I selected no dish of menu 1
Given I selected dish 'D' of menu 2
Given I selected dish 'F' of menu 3
When I save my selections
Then there should be 3 selections
Then there should be a selection with menu 1 of order 'Test Order' and no dish for user 'Bart'
Then there should be a selection with menu 2 of order 'Test Order' and dish 'D' for user 'Bart'
Then there should be a selection with menu 3 of order 'Test Order' and dish 'F' for user 'Bart'

Not all selected

Given I am logged as the user 'Bart'
Given now is '2000-01-01 17:59'
Given an order 'Test Order' with deadline and '2000-01-01 18:00' menus each 3 dishes starting on 2 '2000-01-03'
Given dish 1 of menu 1 of this order is 'A'
Given dish 2 of menu 1 of this order is 'B'
Given dish 1 of menu 2 of this order is 'C'
Given dish 2 of menu 2 of this order is 'D'
Given dish 1 of menu 3 of this order is 'E'
Given dish 2 of menu 3 of this order is 'F'
Given I have opened the page for order 'Test Order'
Given I selected no dish of menu 1
Given I selected dish 'F' of menu 3
When I save my selections
Then there should be 0 selections
Then the error message should be 'Please make a selection for every day'
Then the none option of menu 1 should be checked
Then dish 1 of menu 1 should not be checked
Then dish 2 of menu 1 should not be checked
Then the none option of menu 2 should not be checked
Then dish 1 of menu 2 should not be checked
Then dish 2 of menu 2 should not be checked
Then the none option of menu 3 should not be checked
Then dish 1 of menu 3 should not be checked
Then dish 2 of menu 3 should be checked

_testAdminAfterDeadline

Given now is '2000-01-01 19:12'
Given I am logged in as admin
Given the order 'Test Order' with deadline '2000-01-01 18:00'
Given the user 'Bart'
When I open the page for order for the user 'Test Order' 'Bart'
Then the displayed time left should be '-0d 1h 12m'
Then the selection of 'Bart' should be loaded

_testNothingSelected

Given I am logged as the user 'Bart'
Given now is '2000-01-01 17:59'
Given an order 'Test Order' with deadline and '2000-01-01 18:00' menus each 3 dishes starting on 2 '2000-01-03'
Given I have opened the page for order 'Test Order'
When I save my selections
Then the error message should be 'Please make a selection for every day'