# Manual Integration Test: OData V2 Products App

## DESCRIPTION

Test for the sap.ui.model.odata.type.Unit and sap.ui.model.odata.type.Currency types in combination with the OData V2 model.

## 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 Products V2 application with the following URL (adjust host and port if necessary):

- local: http://localhost:8080/testsuite/test-resources/sap/ui/core/internal/samples/odata/v2/Products/index.html?sap-ui-language=EN

### Testing with back end

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

- local: http://localhost:8080/testsuite/test-resources/sap/ui/core/internal/samples/odata/v2/Products/index.html?realOData=true&sap-ui-language=EN

## REALIZE and CHECK

### Check whether measures are handled properly regarding decimal places defined for the corresponding unit code

#### Testing with mock data

For testing, you may use the following valid unit codes:

- % (0 decimal places)
- PSI (1 decimal places)
- NO (2 decimal places)
- KG and G (3 decimal places)
- 016 (6 decimal places)
- DEG (99 decimal places)

For a complete list of valid unit codes, see the "ExternalCode" property of the objects linked in "Unit Codes" in the test application.

#### Testing with back end

For testing, you may try and use the unit codes listed in "Testing with mock data"; depending on the back end they may however not be available in the back-end customizing. For a complete list of valid unit codes, see the "ExternalCode" property of the objects linked in "Unit Codes" in the test application.

#### Test measures

- Check: Weights in the table are displayed with the number of decimal places associated with the corresponding unit.
- Change the weight for a product in the table to "12.3 NO" and leave the input field.
- Check: The weight is formatted with the decimal places associated with the entered unit code to "12.30 NO".
- Change the weight to "21".
- Check: The weight is formatted with the decimal places associated with the previous unit code to "21.00 NO".
- Change the weight to "12.345 NO".
- Check: You see a validation error message "Enter a number with a maximum of 2 decimal places" and the weight field shows an invalid data state.
- Change the weight unit to an invalid code such as 'XYZ'.
- Check: You see an error message and the weight field shows an invalid data state.
- Change the weight to "32".
- Check: The weight is formatted with the decimal places associated with the last valid unit code 'NO' to "32.00 NO".

Test the following with mock data only

- Change the weight of the product 'Notebook New' which has no weight yet to "42".
- Check: The weight is formatted to "42" and the field has no invalid data state.
- Change the weight of the product 'Notebook New' to "KG".
- Check: You see an error message and the weight field shows an invalid data state.

### Check whether currencies are handled properly regarding decimal places defined for the corresponding currency code

#### Testing with mock data

For testing, you may use the following valid currency codes for testing:

- JPY (0 decimal places)
- EUR and USD (2 decimal places)
- BHD (3 decimal places)
- USDN (5 decimal places)

For a complete list of valid currency codes, see the "CurrencyCode" property of the objects linked in "Currency Codes" in the test application.

#### Testing with back end

For testing, you may use the currency codes listed in "Testing with mock data"; depending on the back end they may however not be available in the back-end customizing. For a complete list of valid currency codes, see the "CurrencyCode" property of the objects linked in "Currency Codes" in the test application.

#### Test currencies

- Check: Prices in the table are displayed with the number of decimal places associated with the corresponding currency.
- Change the price for a product in the table to "12.3 USD" and leave the input field.
- Check: The price is formatted with the decimal places associated with the entered currency code to "12.30 USD".
- Change the price to "21".
- Check: The price is formatted with the decimal places associated with the previous currency code to "21.00 USD".
- Change the price to "12.345 USD".
- Check: You see a validation error message "Enter a number with a maximum of 2 decimal places" and the price field shows an invalid data state.
- Change the currency to an invalid code such as 'XYZ'.
- Check: You see an error message and the price field shows an invalid data state.
- Change the price to "32".
- Check: The price is formatted with the decimal places associated with the last valid currency code 'USD' to "32.00 USD".
- Change the price to "42 $".
- Check: The price is formatted with the decimal places associated with the entered currency code to "42.00 USD".

Test the following with mock data only

- Change the price of the product 'Notebook New' which has no price yet to "42".
- Check: The price is formatted to "42.00" and the field has no invalid data state.
- Change the price of the product 'Notebook New' to "EUR".
- Check: You see an error message and the price field shows an invalid data state.