[AAE-4077] - TaskCloud: Refactor priority (#6385)

* [AAE-4077] - TaskCloud: Refactor priority

* export default priority values

* Fix e2e tests

* fix navigation from task-list

* Update task-list-properties-sort.e2e.ts

* Fix lint

Co-authored-by: Cano <david.cano.nieto@gmail.com>
This commit is contained in:
Silviu Popa
2020-11-26 19:38:40 +02:00
committed by GitHub
parent 5086620991
commit f73dece82d
13 changed files with 99 additions and 53 deletions

View File

@@ -171,6 +171,8 @@ export class DataTableComponentPage {
sortedList = sortedList.sort();
} else if (listType.toLocaleLowerCase() === 'number') {
sortedList = sortedList.sort((a, b) => a - b);
} else if (listType.toLocaleLowerCase() === 'priority') {
sortedList = sortedList.sort(this.sortPriority);
}
if (sortOrder.toLocaleLowerCase() === 'desc') {
@@ -180,6 +182,34 @@ export class DataTableComponentPage {
return initialList.toString() === sortedList.toString();
}
sortPriority(a: string, b: string) {
if (a === b) {
return 0;
}
if (a.toLocaleLowerCase() === 'not set') {
return -1;
}
if (a.toLocaleLowerCase() === 'low') {
if (b === 'not set') {
return 1;
} else {
return -1;
}
}
if (a.toLocaleLowerCase() === 'normal') {
if (b.toLocaleLowerCase() === 'high') {
return -1;
} else {
return 1;
}
}
return 1;
}
async rightClickOnRow(columnName: string, columnValue: string): Promise<void> {
await this.rightClickOnItem(columnName, columnValue);
await BrowserVisibility.waitUntilElementIsVisible(element(by.id('adf-context-menu-content')));
@@ -198,7 +228,7 @@ export class DataTableComponentPage {
async rightClickOnItem(columnName: string, columnValue: string): Promise<void> {
const row = this.getRow(columnName, columnValue);
await BrowserActions.rightClick(row);
}
}
getFileHyperlink(filename: string): ElementFinder {
return element(by.cssContainingText('adf-name-column[class*="adf-datatable-link"] span', filename));