# Manual Integration Test: Create Multiple Sales Orders

## DESCRIPTION

Test creation of multiple entities with the Sales Orders application.

## PREPARATION

To check console errors open the developer tools before starting the application and check with each step, that there are no errors and warnings.

### Testing with mock data

Start the Sales Orders application with following URL (adjust host and port if necessary):

- local: http://localhost:8080/testsuite/test-resources/sap/ui/core/demokit/sample/common/index.html?component=odata.v4.SalesOrders

New sales orders can be created only, if the `Note` property has one of the following values: `"new 1"`, `"new 2"`, `"new 3"`, or `"new 4"` (without quotation marks).

### Testing with back end

Configure your IDE to be able to execute the Sales Orders application against an ABAP back-end system.
Start the Sales Orders application with the URL (adjust host and port if necessary):

- local: http://localhost:8080/testsuite/test-resources/sap/ui/core/demokit/sample/common/index.html?component=odata.v4.SalesOrders&realOData=true

## REALIZE and CHECK

### Multiple create, delete and reset changes

1. Click on the `Create` button in the `Sales Orders` table.
2. Check: The table below the `Create New Sales Order` dialog gets a new first row with an empty `Sales Order ID` and the `Note` as displayed in the `Create New Sales Order` dialog.
3. Modify the content of the `Note` input field of the `Create New Sales Order` dialog for example to: "new 1".
4. Check: The `Note` of the first sales order (table below the dialog) is updated automatically after leaving the input field of the dialog.
5. Click on `OK` in the `Create New Sales Order` dialog.
6. Click on `Save` button in the `Sales Orders` table.
7. Check: You get a success message for creating the sales order.
8. Click on `OK` in the `Success` dialog.
9. Check: The content of the new sales order is updated (for example `Sales Order ID`).
10. Create a second sales order: Repeat steps 1 - 9 for example with the `Note`: "new 2".
11. Create a third sales order: Repeat steps 1 - 5 (do not save!) for example with the `Note`: "new 3".
12. Create a fourth sales order: Repeat steps 1 - 5 (do not save!) for example with the `Note`: "new 4".
13. Select the sales order created in step 11 (with `Note` "new 3").
14. Click on `Delete` button in the `Sales Orders` table.
15. Click on the `OK` button in the `Sales Order Deletion` dialog.
16. Check:You get a success message for the deleted sales order.
17. Click on `OK` in the `Success` dialog.
18. Check: The selected sales order is removed from the `Sales Orders` table.
19. Click on `Cancel sales order list changes` button in the `Sales Orders` table.
20. Check: The not yet saved new sales order created in step 12 is gone.

### Multiple create, POST with back-end error, restart after fix works fine

21. Create 2 new sales orders by repeating steps 11 and 12.
22. Change the `Note` of a not yet saved new sales order (for example with the `Note` "new 4") to "RAISE_ERROR" (without quotation marks).
23. Click on `Save` button in the `Sales Orders` table.
24. Check: The message pop-over opens and you got an error that the value "RAISE_ERROR" for the `Note` property is not allowed.
25. Close the message pop-over.
26. Check: Both sales orders created in step 21 don't have a sales order ID.
27. Change the invalid `Note` from "RAISE_ERROR" to for example "new 4" (without quotation marks).
28. Click on `Save` button in the `Sales Orders` table.
29. Check: You get a success message for creating both sales orders. Confirm each success dialog with `OK`.
30. Check: The content of the two new sales order is updated (for example `Sales Order ID`).

### Multiple create, relative

31. Create a new sales order: Repeat steps 1 - 9 for example with the `Note` : "new 3".
32. Click on the `Create` button in the `Sales Order Line Items` table.
33. Check: You can't select a different sales order in the `Sales Orders` table.
34. Update the `Note` of the newly created sales order line item to "new 10".
35. Create a second sales order line item by clicking on the `Create` button in the `Sales Order Line Items` table.
36. Check: The secondly created sales order line item is inserted after the formerly created one.
37. Update the `Note` of the last created sales order line item to "new 20".
38. Click on the `Save` button in the `Sales Order Details` section.
39. Click on `OK` in the `Success` dialog two times.
40. Check: The `Sales Order Line Items` table header shows 2 `Sales Order Line Items` in realOData mode and 0 in mock data mode.
    Remark: With mock data the table gets empty because of a restriction in the mock server implementation.
41. If `realOData=true`
    - Open the Sales Order Schedules dialog.
    - Check: The table contains two schedules.
    - Click on `Select all`.
    - Click on `Delete selected schedules`.
    - Check: The `Sales Order Schedules` table is empty.
    - Close the Sales Orders Schedules dialog.
    - Check: The `Sales Order Line Items` table is empty.
42. Check: You now can select a different sales order in the `Sales Orders` table.