Files
mozo-backend/spec/acceptance/suppliers/dashboard.feature
T

126 lines
5.7 KiB
Gherkin

Feature: Supplier main board
@javascript
Scenario: the active list should be present and contained in row having its id
Given there is an active list and order
And there is another section with table
And I am signed in as supplier
When I visit the supplier root path
Then the supplier dashboard should display the active list
And the supplier dashboard should display the active order
#When I click on translation 'supplier.order.being_processed'
When I click on selector '.active-orders-table .mark_order_active'
# waiting here only needed in old style implementation
And I wait 1 second
Then the supplier order row should be marked as active
#When I click on translation 'supplier.order.being_served'
When I click on selector '.active-orders-table .mark_order_delivered'
And I wait 1 second
Then the order in the supplier dashboard should not be displayed anymore
And the order should be marked as delivered
And the list on the supplier dashboard should not be marked as in need of help
When the list is marked as in need of help
# waiting here only needed in old style implementation
And I wait 1 second
Then the list on the supplier dashboard should be marked as in need of help
When I click on the mark list as helped button in the supplier dashboard
Then the list on the supplier dashboard should not be marked as in need of help
When the list is marked as in need of payment
Then the list on the supplier dashboard should be marked as in need of payment
When another order is placed
Then the supplier dashboard list should display the updated price
And the new order should be present in the supplier dashboard
When a new order on a table in another section is created
And I wait 1 second
Then the new list should appear in the supplier dashboard
And the new order on a table in another section should be present in the supplier dashboard
When I click on the close list button in the supplier dashboard
And confirm the supplier close list modal
And I wait 1 second
Then the list in the supplier dashboard should not be displayed anymore
And the list should be marked as closed
@javascript
Scenario: Selecting a specific section limits the result to the lists and orders of those sections
Given there is an active list and order
And there is another section with table
And I am signed in as supplier
When I visit the supplier root path
And a new order on a table in another section is created
Then I should see the list and the new list
And I should see the order and the new order
When I select the section in the supplier dashboard
Then I should see the list and order but not the new list and new order
When I select the other section in the supplier dashboard
Then I should see the new list and new order but not the list and order
When I reset the section selector in the supplier dashboard
Then I should see the list and the new list
And I should see the order and the new order
@javascript
Scenario: Selecting a specific section and jumping towards section view
Given there is an active list and order
And I am signed in as supplier
When I visit the supplier root path
And I select the section in the supplier dashboard
And I click on the section main board section jumper
Then I should be redirected to the supplier section view
@javascript
Scenario: Update table number and section if table changes
Given there is an active list and order
And there is another section with table
And I am signed in as supplier
When I visit the supplier root path
# wait until page is fully loaded, could be a pure ruby command inside a within :selector statement since the browser will wait for the selector to be present and then the lists are loaded
And I wait 4 seconds
When the active list changes to another table in another section
And I wait 2 seconds
Then the supplier main board table number should be updated to the new table number
And the supplier main board section name should be updated to the new section
@javascript
Scenario: Remove an order
Given there is an active list and order
And I am signed in as supplier
When I visit the supplier root path
And the supplier marks the order as wrong in the main board view
Then the supplier main board order should not be visible anymore
And the supplier main board list total should be updated
And the supplier placed orders counter should be reduced
@javascript
Scenario: Closing list with active orders updates supplier counters
Given there is an active list and order
And I am signed in as supplier
When I visit the supplier root path
And I click on the close list button in the supplier dashboard
And confirm the supplier close list modal
Then the supplier placed orders counter should be reduced
@javascript
Scenario: Selecting a specific section limits the result to the lists and orders of those sections
Given there is an active list and order
And there is another section with table
And I am signed in as supplier
When I visit the supplier root path
And a new order on a table in another section is created
Then I should see the list and the new list
And I should see the order and the new order
When I select the section in the supplier dashboard
Then I should see the list and order but not the new list and new order
When I select the other section in the supplier dashboard
Then I should see the new list and new order but not the list and order
When I reset the section selector in the supplier dashboard
Then I should see the list and the new list
And I should see the order and the new order