[ADF-4559] Add chips to multivalue metadata properties (#5552)

* [ADF-4559] Add chips to multivalue metadata properties

* Fix app config schema

* Restore app config

* Fix checkListIsSorted method

* Fix e2e datatable sorting

* Fix e2e tests

* Improve chips input
This commit is contained in:
davidcanonieto
2020-03-23 13:02:01 +00:00
committed by GitHub
parent 666dd45fa2
commit 144da83d0e
9 changed files with 223 additions and 95 deletions

View File

@@ -118,14 +118,15 @@ export class DataTableComponentPage {
*
* @param sortOrder: 'ASC' if the list is await expected to be sorted ascending and 'DESC' for descending
* @param columnTitle: titleColumn column
* @param listType: 'string' for string typed lists and 'number' for number typed (int, float) lists
* @return 'true' if the list is sorted as await expected and 'false' if it isn't
*/
async checkListIsSorted(sortOrder: string, columnTitle: string): Promise<any> {
async checkListIsSorted(sortOrder: string, columnTitle: string, listType: string = 'STRING'): Promise<any> {
const column = element.all(by.css(`div.adf-datatable-cell[title='${columnTitle}'] span`));
await BrowserVisibility.waitUntilElementIsVisible(column.first());
const initialList = [];
const length = await column.count();
const length = await column.count();
for (let i = 0; i < length; i++) {
const text = await BrowserActions.getText(column.get(i));
@@ -135,7 +136,12 @@ export class DataTableComponentPage {
}
let sortedList = [...initialList];
sortedList = sortedList.sort();
if (listType.toLocaleLowerCase() === 'string') {
sortedList = sortedList.sort();
} else if (listType.toLocaleLowerCase() === 'number') {
sortedList = sortedList.sort((a, b) => a - b);
}
if (sortOrder.toLocaleLowerCase() === 'desc') {
sortedList = sortedList.reverse();
}