# EC1-232 - View Order Based on Supplier
> As a Sinbad Admin, I should be able to view order coming from particular suppliers, so that I can get specific order information in particular supplier's order
>JIRA Ticket: https://sinbadkp.atlassian.net/browse/EC1-232?atlOrigin=eyJpIjoiZmNjNGVhNzMyOTNiNDA0ZDkwNmVjMWM5YTFhMjdmMzIiLCJwIjoiaiJ9
# API Testing
## Test Scenarios
#### Test Scenario 1
```gherkin
Scenario: As an Admin, I want to hit get orders endpoint with supplier filter
Given the user has logged in as Admin
When the user input correct supplierId to suppliers param
And the user hit endpoint get-orders
Then successfully filter the order list
And show response for order based on the chosen supplier
```
#### Test Scenario 2
```gherkin
Scenario: As an Admin, I should get error message for non-existent supplier ID
Given the user has logged in as Admin
When the user input non-existent supplierId to suppliers param
And the user hit endpoint get-orders
Then failed to filter the order list
And show error response message
```
#### Test Scenario 3
```gherkin
Scenario: As an Admin, I should get error message for incorrect supplier ID
Given the user has logged in as Admin
When the user input incorrect format supplierId to suppliers param
And the user hit endpoint get-orders
Then failed to filter the order list
And show error response message
```
#### Test Scenario 4
```gherkin
Scenario: As an Admin, I want to hit get orders endpoint with multiple suppliers filter
Given the user has logged in as Admin
When the user input correct supplierId to suppliers param
And the user input second correct supplierId to suppliers param
And the user hit endpoint get-orders
Then successfully filter the order list
And show response for order based on the chosen suppliers
```
#### Test Scenario 5
```gherkin
Scenario: As an Admin, I want to hit get orders endpoint with order status filter
Given the user has logged in as Admin
When the user input correct order status to statuses param
And the user hit endpoint get-orders
Then successfully filter the order list
And show response for order based on the chosen order status
```
#### Test Scenario 6
```gherkin
Scenario: As an Admin, I should get error message for incorrect order status
Given the user has logged in as Admin
When the user input incorrect order status to statuses param
And the user hit endpoint get-orders
Then failed to filter the order list
And show error response message
```
#### Test Scenario 7
```gherkin
Scenario: As an Admin, I want to hit get orders endpoint with multiple order status filter
Given the user has logged in as Admin
When the user input correct order status to statuses param
And the user input second correct order status to statuses param
And the user hit endpoint get-orders
Then successfully filter the order list
And show response for order based on the chosen order statuses
```
#### Test Scenario 8
```gherkin
Scenario: As an Admin, I want to hit get orders endpoint with order amount filter
Given the user has logged in as Admin
When the user input correct amount on minOrderValue
And the user input correct amount on maxOrderValue
And the user hit endpoint get-orders
Then successfully filter the order list
And show response for order based on the chosen range of order amount
```
#### Test Scenario 9
```gherkin
Scenario Outline: As an Admin, I should get error message for incorrect order amount range
Given the user has logged in as Admin
When the user input order amount value <orderAmount>
And the user hit endpoint get-orders
Then failed to filter the order list
And show error response message
Examples:
| orderAmount |
| minOrderAmount > maxOrderAmount |
| Negative minOrderAmount |
| Negative maxOrderAmount |
```
#### Test Scenario 10
```gherkin
Scenario: As an Admin, I want to hit get orders endpoint with order date filter
Given the user has logged in as Admin
When the user input correct date on minOrderDate
And the user input correct date on maxOrderDate
And the user hit endpoint get-orders
Then successfully filter the order list
And show response for order based on the chosen range of order date
```
#### Test Scenario 11
```gherkin
Scenario Outline: As an Admin, I should get error message for incorrect format order date range
Given the user has logged in as Admin
When the user input order date value <orderDate>
And the user hit endpoint get-orders
Then failed to filter the order list
And show error response message
Examples:
| orderDate |
| minOrderDate > maxOrderDate |
| minOrderDate > currentDate |
| wrong format minOrderDate |
| wrong format maxOrderDate |
```
#### Test Scenario 12
```gherkin
Scenario: As an Admin, I want to hit get orders endpoint with deliver date filter
Given the user has logged in as Admin
When the user input correct date on minDeliveredDate
And the user input correct date on maxDeliveredDate
And the user hit endpoint get-orders
Then successfully filter the order list
And show response for order based on the chosen range of delivered date
```
#### Test Scenario 13
```gherkin
Scenario Outline: As an Admin, I should get error message for incorrect format deliver date range
Given the user has logged in as Admin
When the user input delivered date value <deliverDate>
And the user hit endpoint get-orders
Then failed to filter the order list
And show error response message
Examples:
| deliverDate |
| minDeliverDate > maxDeliverDate |
| minDeliverDate > currentDate |
| wrong format minDeliverDate |
| wrong format maxDeliverDate |
```
# Functional Testing
## Test Scenarios
#### Test Scenario 1
```gherkin
Scenario: As an Admin, I want to access Filter Menu
Given the user has logged in to Admin Panel
And the user is on OMS Page
When the user clicks 'Filter' button
Then shows Filter Menu
```
#### Test Scenario 2
```gherkin
Scenario: As an Admin, I want to filter for TRS Supplier only
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user clicks 'TRS' on Supplier Section
And the user clicks 'Apply' button
Then redirects back to OMS Page
And show order from TRS Supplier only
```
#### Test Scenario 3
```gherkin
Scenario: As an Admin, I shouldn't be able to see order from other supplier after filtered
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user clicks 'TRS' on Supplier Section
And the user clicks 'Apply' button
Then redirects back to OMS Page
And show order from TRS Supplier only
And hide other supplier's orders
```
#### Test Scenario 4
```gherkin
Scenario: As an Admin, I want to filter for multiple suppliers
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user clicks 'TRS' on Supplier Section
And the user clicks 'Lakme' on Supplier Section
And the user clicks 'Apply' button
Then redirects back to OMS Page
And show order from TRS & Lakme Supplier only
And hide other supplier's orders
```
#### Test Scenario 5
```gherkin
Scenario: As an Admin, I want to filter based on Order Status
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user clicks 'New Order' on Order Status Section
And the user clicks 'Apply' button
Then redirects back to OMS Page
And show order with 'New Order' status only
```
#### Test Scenario 6
```gherkin
Scenario: As an Admin, I shouldn't be able to see order with other order status after filtered
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user clicks 'New Order' on Order Status Section
And the user clicks 'Apply' button
Then redirects back to OMS Page
And show order with 'New Order' status only
And hide orders with other status
```
#### Test Scenario 7
```gherkin
Scenario: As an Admin, I want to filter based on multiple Order Status
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user clicks 'New Order' on Order Status Section
And the user clicks 'Pending' on Order Status Section
And the user clicks 'Apply' button
Then redirects back to OMS Page
And show order with 'New Order' & 'Pending' status only
```
#### Test Scenario 8
```gherkin
Scenario: As an Admin, I want to filter based on Order Amount
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user input correct amount on min Order Amount
And the user input correct amount on max Order Amount
And the user clicks 'Apply' button
Then redirects back to OMS Page
And show order in range of min and max order amount
```
#### Test Scenario 9
```gherkin
Scenario: As an Admin, I shouldn't be able to see order with other order amount after filtered
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user input correct amount on min Order Amount
And the user input correct amount on max Order Amount
And the user clicks 'Apply' button
Then redirects back to OMS Page
And show order in range of min and max order amount
And hide order with range out from min and max order amount
```
#### Test Scenario 10
```gherkin
Scenario: As an Admin, I shouldn't be able to input negative amount in order amount field
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user input negative amount on min Order Amount
Then the user failed to input min Order Amount
```
#### Test Scenario 11
```gherkin
Scenario: As an Admin, I shouldn't be able to filter when min order amount > max order amount
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user input correct amount on min Order Amount
And the user input correct amount on max Order Amount
And the user clicks 'Apply' button
Then redirects back to OMS Page
And show error message
```
#### Test Scenario 12
```gherkin
Scenario: As an Admin, I want to filter based on Order Date
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user input correct date on min Order Date
And the user input correct date on max Order Date
And the user clicks 'Apply' button
Then redirects back to OMS Page
And show order in range of min and max order date
```
#### Test Scenario 13
```gherkin
Scenario: As an Admin, I shouldn't be able to see order with other order date after filtered
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user input correct date on min Order Date
And the user input correct date on max Order Date
And the user clicks 'Apply' button
Then redirects back to OMS Page
And show order in range of min and max order date
And hide order out range of min and max order date
```
#### Test Scenario 14
```gherkin
Scenario: As an Admin, I shouldn't be able to pick future date for min order date
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user clicks the calendar icon for min Order Date
And the user clicks future date
And the user clicks 'Apply'
Then show error message
```
#### Test Scenario 15
```gherkin
Scenario: As an Admin, I shouldn't be able to filter when min order date > max order date
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user input correct date on min Order Date
And the user input max order date with date < min Order Date
And the user clicks 'Apply'
Then show error message
```
#### Test Scenario 16
```gherkin
Scenario: As an Admin, I want to filter based on Deliver Date
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user input correct date on min Deliver Date
And the user input correct date on max Deliver Date
And the user clicks 'Apply' button
Then redirects back to OMS Page
And show order in range of min and max deliver date
```
#### Test Scenario 17
```gherkin
Scenario: As an Admin, I shouldn't be able to see order with other deliver date after filtered
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user input correct date on min Deliver Date
And the user input correct date on max Deliver Date
And the user clicks 'Apply' button
Then redirects back to OMS Page
And show order in range of min and max deliver date
And hide order out range of min and max deliver date
```
#### Test Scenario 18
```gherkin
Scenario: As an Admin, I shouldn't be able to choose future date for min deliver date
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user clicks the calendar icon for min Deliver Date
And the user clicks future date
And the user clicks 'Apply'
Then show error message
```
#### Test Scenario 19
```gherkin
Scenario: As an Admin, I shouldn't be able to filter when min deliver date > max deliver date
Given the user has logged in to Admin Panel
And the user is on OMS Page
And the user has opened Filter Menu
When the user input correct date on min Deliver Date
And the user input max deliver date with date < min Deliver Date
And the user clicks 'Apply'
Then show error message
```
###### tags: `Sprint 22` `Sprint 21` `Ecommerce 1` `Admin Panel`