mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-3638] - implement priority drodpown widget (#6351)
* [AAE-3638] - implement priority drodpown widget * refactor task cloud service function * fix remove value on card view text item and move priorities values in app.config.json * revert app config unnecary changes * PR changes * fix unit test * fix more unit tests * PR changes * create task cloud response model * remove commented code * fix e2e * fix start task e2e and add return type
This commit is contained in:
@@ -16,13 +16,14 @@
|
||||
*/
|
||||
|
||||
import { element, by, ElementFinder, Locator } from 'protractor';
|
||||
import { BrowserVisibility } from '../../utils/public-api';
|
||||
import { BrowserActions, BrowserVisibility } from '../../utils/public-api';
|
||||
import { DropdownPage } from '../material/dropdown.page';
|
||||
|
||||
export class CardSelectItemPage {
|
||||
|
||||
rootElement: ElementFinder;
|
||||
labelLocator: Locator = by.css('div[data-automation-id*="card-select-label"]');
|
||||
readOnlyField: Locator = by.css('[data-automation-class="read-only-value"]');
|
||||
dropdown: DropdownPage;
|
||||
|
||||
constructor(label: string = 'fileSource') {
|
||||
@@ -39,7 +40,16 @@ export class CardSelectItemPage {
|
||||
return this.dropdown.getSelectedOptionText();
|
||||
}
|
||||
|
||||
async getReadonlyValue(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.element(this.readOnlyField));
|
||||
return BrowserActions.getText(this.rootElement.element(this.readOnlyField));
|
||||
}
|
||||
|
||||
async selectDropdownOption(option: string): Promise<void> {
|
||||
await this.dropdown.selectDropdownOption(option);
|
||||
}
|
||||
|
||||
async checkElementIsReadonly(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.element(this.readOnlyField));
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ export class EditTaskFilterCloudComponentPage {
|
||||
|
||||
customiseFilter = element(by.id('adf-edit-task-filter-sub-title-id'));
|
||||
assignee = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-assignee"]'));
|
||||
priority = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-priority"]'));
|
||||
priority = element(by.css('[data-automation-id="adf-cloud-edit-task-property-priority"]'));
|
||||
taskName = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-taskName"]'));
|
||||
id = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-taskId"]'));
|
||||
processDefinitionId = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-processDefinitionId"]'));
|
||||
@@ -50,6 +50,7 @@ export class EditTaskFilterCloudComponentPage {
|
||||
appNameDropdown = new DropdownPage(this.locatorAppNameDropdown);
|
||||
statusDropdown = new DropdownPage(this.locatorStatusDropdown);
|
||||
sortDropdown = new DropdownPage(this.locatorSortDropdown);
|
||||
priorityDropdown = new DropdownPage(this.priority);
|
||||
orderDropdown = new DropdownPage(this.locatorOrderDropdown);
|
||||
completedDateDropdown = new DropdownPage(this.locatorCompletedDateDropdown);
|
||||
|
||||
@@ -116,7 +117,8 @@ export class EditTaskFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
async setPriority(option): Promise<void> {
|
||||
await this.setProperty('priority', option);
|
||||
await this.priorityDropdown.selectDropdownOption(option);
|
||||
await this.dataTable.waitTillContentLoaded();
|
||||
}
|
||||
|
||||
async getPriority(): Promise<string> {
|
||||
|
@@ -18,13 +18,14 @@
|
||||
import { element, by, Key, ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
import { DropdownPage } from '../../core/pages/material/dropdown.page';
|
||||
|
||||
export class StartTasksCloudPage {
|
||||
|
||||
name = element(by.css('input[id="name_id"]'));
|
||||
dueDate = element(by.css('input[id="date_id"]'));
|
||||
description = element(by.css('textarea[id="description_id"]'));
|
||||
priority = element(by.css('input[formcontrolname="priority"]'));
|
||||
priority = element(by.css('mat-select[formcontrolname="priority"]'));
|
||||
startButton = element(by.css('button[id="button-start"]'));
|
||||
startButtonEnabled = element(by.css('button[id="button-start"]:not(disabled)'));
|
||||
cancelButton = element(by.css('button[id="button-cancel"]'));
|
||||
@@ -45,7 +46,9 @@ export class StartTasksCloudPage {
|
||||
}
|
||||
|
||||
async addPriority(userPriority: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.priority, userPriority);
|
||||
// await BrowserActions.clearSendKeys(this.priority, userPriority);
|
||||
const priorityDropdown = new DropdownPage(this.priority);
|
||||
await priorityDropdown.selectDropdownOption(userPriority);
|
||||
}
|
||||
|
||||
async addDueDate(date: string): Promise<void> {
|
||||
|
@@ -19,12 +19,13 @@ import { element, by } from 'protractor';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { CardTextItemPage } from '../../core/pages/card-view/card-view-text-item.page';
|
||||
import { CardSelectItemPage } from '../../core/pages/card-view/card-view-select-item.page';
|
||||
|
||||
export class TaskHeaderCloudPage {
|
||||
|
||||
assigneeCardTextItem = new CardTextItemPage('assignee');
|
||||
statusCardTextItem = new CardTextItemPage('status');
|
||||
priorityCardTextItem = new CardTextItemPage('priority');
|
||||
priorityCardSelectItem = new CardSelectItemPage('priority');
|
||||
dueDateField = element.all(by.css('span[data-automation-id*="dueDate"] span')).first();
|
||||
categoryCardTextItem = new CardTextItemPage('category');
|
||||
createdField = element(by.css('span[data-automation-id="card-dateitem-created"] span'));
|
||||
@@ -44,7 +45,11 @@ export class TaskHeaderCloudPage {
|
||||
}
|
||||
|
||||
async getPriority(): Promise<string> {
|
||||
return this.priorityCardTextItem.getFieldValue();
|
||||
return this.priorityCardSelectItem.getSelectedOptionText();
|
||||
}
|
||||
|
||||
async getReadonlyPriority(): Promise<string> {
|
||||
return this.priorityCardSelectItem.getReadonlyValue();
|
||||
}
|
||||
|
||||
async getCategory(): Promise<string> {
|
||||
|
Reference in New Issue
Block a user