# Manual Integration Test: Create and Change Sales Orders via Auto/Direct application groups

## DESCRIPTION

Test whether POST and PATCH requests for groups with SubmitMode.Auto/.Direct are parked in error case and restarted automatically once the user input is corrected.

## PREPARATION

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

### Testing only possible with realOData=true

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

- SubmitMode.Auto http://localhost:8080/testsuite/test-resources/sap/ui/core/demokit/sample/common/index.html?component=odata.v4.SalesOrders&realOData=true&updateGroupId=myAutoGroup
- SubmitMode.Direct http://localhost:8080/testsuite/test-resources/sap/ui/core/demokit/sample/common/index.html?component=odata.v4.SalesOrders&realOData=true&updateGroupId=myDirectGroup

## REALIZE and CHECK

### Create a new invalid Sales Order and correct

Note: An invalid Sales Order for SubmitMode.Auto or .Direct can only be created via API, hence we have to create it via API within developer tools F12 -> console

1. Create an invalid Sales Order via console: `sap.ui.getCore().byId("sap.ui.core.sample.odata.v4.SalesOrders.Main--SalesOrders").getBinding("items").create({"Note" : "RAISE_ERROR", "BuyerID" : "0100000000", "LifecycleStatus" : "N"})`
2. Observe that an error message is sent; close the error popup
3. Change the Sales Order 'Note' to some other value
4. Observe that no error message is sent and the order is created

### Change the newly created or an already existing Sales Order

1. In the 'Note' field type in the value RAISE_ERROR
2. You should get an error that this value is not allowed
3. Select the error in the message popover.
4. Check: There is a link with text "Technical Details".
5. Click the link.
6. Check: A popover opens with the technical details as JSON.
7. Close the technical details popover.
8. Click on the message title "Property `Note` value `RAISE_ERROR` not allowed!"
9. Check: The `Note` field of the right sales order gets focused and the same message is highlighted below/beside the input field.
10. Correct the value and observe that a new PATCH request is automatically send when leaving the field.

### Only for SubmitMode.Auto

1. Press the `Create` button for the Sales Order Line Items list
2. Close the `Success` dialog; ignore any warnings and errors at this point
3. Enter a 0 value for the 'Quantity' field and press ENTER
4. Observe the error message "Value must be greater than 0"; close the error popup
5. Enter any value for the 'Note' field and press ENTER
6. Observe that the error message "Value must be greater than 0" is sent again; close the error popup
7. Enter the value 2 for the 'Quantity' field and press ENTER
8. Observe that no error message is sent
9. Press the `Refresh selected sales order` button for the Sales Orders list
10. Observe that no error message is sent and that both the 'Note' and 'Quantity' fields have the right value

# Manual Integration Test: Support PATCH With 204 "No Content"

## DESCRIPTION

Test whether PATCH responses with 204 "No Content" are handled correctly, including the "ETag" header.

## 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 only possible without realOData=true

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

- SubmitMode.Auto http://localhost:8080/testsuite/test-resources/sap/ui/core/demokit/sample/common/index.html?component=odata.v4.SalesOrders&updateGroupId=myAutoGroup
- SubmitMode.Direct http://localhost:8080/testsuite/test-resources/sap/ui/core/demokit/sample/common/index.html?component=odata.v4.SalesOrders&updateGroupId=myDirectGroup

## REALIZE and CHECK

### Second edit uses ETag returned in response header of first edit

1. In the second row's 'Note' field, type in the value "204" and press ENTER.
2. In the second row's 'Note' field, type in any other value, for example "*", and press ENTER.
3. Observe that the 'Note' field turns into "You have used the new ETag!"
4. Press the `Refresh` button for the Sales Order List.
5. In the second row's 'Note' field, type in the value "ETag" and press ENTER.
6. Observe that the 'Note' field turns into "Sending ETag header..."
7. In the second row's 'Note' field, type in any other value, for example "*", and press ENTER.
8. Observe that the 'Note' field turns into "You have used the new ETag!"