# Manual Integration Test: Data Aggregation

## DESCRIPTION

Test scrolling and expanding of aggregated data.

## 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. Ignore initial message bundle errors.

### Testing with mock data

Start the Data Aggregation application URL (adjust host and port if necessary):

- local: http://<host>:<port>/testsuite/test-resources/sap/ui/core/demokit/sample/common/index.html?component=odata.v4.DataAggregation

## REALIZE and CHECK

### 0. Grand Total

Check: The table should have the following content:

Level | (Icon's Tooltip) | Country | Region | Segment | Account Responsible | Sales Amount | Local Currency | Sales Number | Is Total
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
0 | Collapse |  |  |  |  | 79,443,315 |  |  |
1 | Expand | United Kingdom |  |  |  | 14,548,502 | GBP |  |
1 | Expand | USA |  |  |  | 40,405,175 | USD |  |
1 | Expand | Germany |  |  |  | 24,489,638 | EUR |  |

### 1. Expand `Germany` (no region)

1. Click on the expand button in the row with country `Germany`.
2. Check: One new row appears below that row, with country `Germany` and region `Saxony`.

### 2. Scroll to the end of the table

1. Click on any `Germany` to move the focus to the table.
2. Press CTRL-END to scroll to the end of the table.
3. Check: The grand total row is still displayed at the top, and the row with country `Germany` and region `Hamburg` is displayed next.

### 3. Expand the last visible node

1. Click on the expand button of the last visible row (with region `Baden-Württemberg`).
2. Check: The scrollbar of the table has changed.
3. Click on any `Germany` to move the focus to the table.
4. Press CTRL-END to scroll to the end of the table.
5. Check: The grand total row is still displayed at the top, and the row with country `Germany` and region `Baden-Württemberg` is displayed next.

### 4. Expand the last visible node

1. Click on the expand button of the last visible row with region `Baden-Württemberg` and the segment `Small`.
2. Check: The scrollbar of the table has changed.
3. Click on any `Germany` to move the focus to the table.
4. Press CTRL-END to scroll to the end of the table.
5. Check: The table should have the following content:

   Level | (Icon's Tooltip) | Country | Region | Segment | Account Responsible | Sales Amount | Local Currency | Sales Number | Is Total
   --- | --- | --- | --- | --- | --- | --- | --- | --- | ---
   0 | Collapse |  |  |  |  | 79,443,315 |  |  |
   3 | Expand | Germany | Baden-Württemberg | Mid-size |  | 526,122 | EUR |  |
   3 | Collapse | Germany | Baden-Württemberg | Small |  | 125,093 | EUR |  |
   4 | Leaf | Germany | Baden-Württemberg | Small | Erwin Fischer | 61,632 | EUR | 1,032 |
   4 | Leaf | Germany | Baden-Württemberg | Small | Winfried Maier | 63,461 | EUR | 1,178 |

### 5. Collapse `Germany` (no region)

1. Press CTRL-HOME to scroll to the start of the table.
2. Click on the collapse button of the row with country `Germany` and no region.
3. Check: The table should have the same content as initially.

### 6. Expand `Germany` (no region) again

1. Click on the expand button in the row with country `Germany` and no region.
2. Click on any `Germany` to move the focus to the table.
3. Press CTRL-END to scroll to the end of the table.
4. Check: The table should have the same content as described in #4.4.

### 7. Grand Total at Bottom Only

1. Add the URL parameter `&grandTotalAtBottomOnly=true` to the original URL and repeat the above steps 0 through 6.
2. Check: The grand total row (the one with level 0) is now displayed at the bottom only (instead of the top), but everything else works the same.

### 8. Grand Total at Top and Bottom

1. Add the URL parameters `&grandTotalAtBottomOnly=false&visibleRowCount=6` to the original URL and repeat the above steps 0 through 6.
2. Check: The grand total row (the one with level 0) is now displayed both at the top and bottom, but everything else works the same.
3. Check:The grand total row copy at the bottom is shown as a leaf.

### 9. Subtotals at Bottom Only

1. Add the URL parameters `&subtotalsAtBottomOnly=true` to the original URL and repeat the above steps 0 through 6.
2. Check: Whenever a node is expanded, subtotals are not shown in the same row anymore, but as a separate row after all children. It has the same level, is marked as a total row, and is a leaf. Everything else works the same.

### 10. Subtotals at Top and Bottom

1. Add the URL parameters `&subtotalsAtBottomOnly=false` to the original URL and repeat the above steps 0 through 6.
2. Check: Whenever a node is expanded, subtotals are still shown in the same row as before and as a separate row after all children. It has the same level, is marked as a total row, and is a leaf. Everything else works the same.
3. Feel free to test any combination of grand total and subtotals placement.

### 11. "Download"

1. Click the download button in the upper right corner.
2. Check: A new browser window or tab opens with the raw data. In theory, you should be able to save it as a JSON file and import that into Excel.