AAE-1951 - added extra test cases for start task and assignee (#5534)

* AAE-1951 - added extra test cases for start task and assignee

* AAE-1951 - fixed license
This commit is contained in:
Eugenio Romano
2020-03-05 17:37:34 +00:00
committed by GitHub
parent a70883378a
commit 6db04f1887
6 changed files with 104 additions and 3 deletions

View File

@@ -17,7 +17,6 @@
import { element, by, ElementFinder, Locator } from 'protractor';
import { BrowserActions, BrowserVisibility } from '../../utils/public-api';
export class CardTextItemPage {
rootElement: ElementFinder;
@@ -27,6 +26,9 @@ export class CardTextItemPage {
field: Locator = by.css('span[data-automation-id*="card-textitem-value"] span');
labelLocator: Locator = by.css('div[data-automation-id*="card-textitem-label"]');
toggle: Locator = by.css('div[data-automation-id*="card-textitem-toggle"]');
editButton: Locator = by.css('button.adf-textitem-action[title*=Edit]');
errorMessage: Locator = by.css('.adf-textitem-editable-error');
clickableElement: Locator = by.css('.adf-textitem-clickable');
constructor(label: string = 'assignee') {
this.rootElement = element(by.xpath(`//div[contains(@data-automation-id, "label-${label}")]/ancestor::adf-card-view-textitem`));
@@ -59,4 +61,18 @@ export class CardTextItemPage {
async clickOnClearButton(): Promise<void> {
await BrowserActions.click(this.rootElement.element(this.clearButton));
}
async clickOnEditButton(): Promise<void> {
await BrowserActions.click(this.rootElement.element(this.editButton));
}
async getErrorMessage(): Promise<string> {
const errorField = this.rootElement.element(this.errorMessage);
return BrowserActions.getText(errorField);
}
async checkElementIsReadonly(): Promise <void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.rootElement.element(this.clickableElement));
await BrowserVisibility.waitUntilElementIsNotVisible(this.rootElement.element(this.editButton));
}
}

View File

@@ -27,6 +27,7 @@ export class PeopleCloudComponentPage {
formFields: FormFields = new FormFields();
labelLocator: Locator = by.css("label[class*='adf-label']");
inputLocator: Locator = by.css('input');
assigneeChipList: ElementFinder = element(by.css('mat-chip-list[data-automation-id="adf-cloud-people-chip-list"]'));
async clearAssignee(): Promise<void> {
await BrowserActions.clearSendKeys(this.peopleCloudSearch, ' ');
@@ -62,6 +63,11 @@ export class PeopleCloudComponentPage {
return this.peopleCloudSearch.getAttribute('value');
}
async getChipAssignee(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.assigneeChipList);
return this.assigneeChipList.all(by.css('mat-chip')).first().getText();
}
async checkUserIsDisplayed(name: string): Promise<void> {
const assigneeRow = element(by.cssContainingText('mat-option span.adf-people-label-name', name));
await BrowserVisibility.waitUntilElementIsVisible(assigneeRow);
@@ -72,6 +78,16 @@ export class PeopleCloudComponentPage {
await BrowserVisibility.waitUntilElementIsNotVisible(assigneeRow);
}
async checkOptionIsDisplayed(): Promise <void> {
const optionList = element(by.css('.adf-people-cloud-list'));
await BrowserVisibility.waitUntilElementIsVisible(optionList);
}
async checkOptionIsNotDisplayed(): Promise <void> {
const optionList = element(by.css('.adf-people-cloud-list'));
await BrowserVisibility.waitUntilElementIsNotVisible(optionList);
}
async checkSelectedPeople(person: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText('mat-chip-list mat-chip', person)));
}

View File

@@ -30,6 +30,7 @@ export class StartTasksCloudPage {
cancelButton: ElementFinder = element(by.css('button[id="button-cancel"]'));
form: ElementFinder = element.all(by.css('adf-cloud-start-task form')).first();
formDefinitionSelector: ElementFinder = element(by.css('.adf-form-definition-selector'));
priorityStartTaskField: ElementFinder = element(by.css('input[formControlName="priority"]'));
async checkFormIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.form);
@@ -105,4 +106,9 @@ export class StartTasksCloudPage {
await BrowserVisibility.waitUntilElementIsNotVisible(row);
await BrowserActions.closeMenuAndDialogs();
}
async typePriorityOf(priorityValue: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.priorityStartTaskField);
await BrowserActions.clearSendKeys(this.priorityStartTaskField, priorityValue);
}
}

View File

@@ -86,5 +86,4 @@ export class TaskHeaderCloudPage {
async checkTaskPropertyListIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.taskPropertyList);
}
}