[ADF-5463] Rework Protractor tests - changes related to element/element… (#7284)

* ADF-5463 Rework Protractor tests - changes related to element/elements and duplication of locators

* Fix one which I missed

* Remove console.logs

* Remove console.logs

* Reverse the timeouts

* Fixed things TSLint

* Remove unused import

* Fixed broken tests

* Last test fixed
This commit is contained in:
MichalFidor
2021-10-08 17:28:37 +02:00
committed by GitHub
parent db6a638a2d
commit 1e62b46060
156 changed files with 1653 additions and 1647 deletions

View File

@@ -16,26 +16,26 @@
*/
import { BrowserActions, BrowserVisibility, DropdownPage, PaginationPage } from '@alfresco/adf-testing';
import { by, element } from 'protractor';
import { $ } from 'protractor';
import { TasksListPage } from './tasks-list.page';
export class TaskListDemoPage {
taskListPage = new TasksListPage();
appId = element(by.css("input[data-automation-id='appId input']"));
itemsPerPage = element(by.css("input[data-automation-id='items per page']"));
itemsPerPageForm = element(by.css("mat-form-field[data-automation-id='items per page']"));
processDefinitionId = element(by.css("input[data-automation-id='process definition id']"));
processInstanceId = element(by.css("input[data-automation-id='process instance id']"));
page = element(by.css("input[data-automation-id='page']"));
pageForm = element(by.css("mat-form-field[data-automation-id='page']"));
taskName = element(by.css("input[data-automation-id='task name']"));
resetButton = element(by.css('.app-reset-button button'));
dueBefore = element(by.css("input[data-automation-id='due before']"));
dueAfter = element(by.css("input[data-automation-id='due after']"));
taskId = element(by.css("input[data-automation-id='task id']"));
appId = $("input[data-automation-id='appId input']");
itemsPerPage = $("input[data-automation-id='items per page']");
itemsPerPageForm = $("mat-form-field[data-automation-id='items per page']");
processDefinitionId = $("input[data-automation-id='process definition id']");
processInstanceId = $("input[data-automation-id='process instance id']");
page = $("input[data-automation-id='page']");
pageForm = $("mat-form-field[data-automation-id='page']");
taskName = $("input[data-automation-id='task name']");
resetButton = $('.app-reset-button button');
dueBefore = $("input[data-automation-id='due before']");
dueAfter = $("input[data-automation-id='due after']");
taskId = $("input[data-automation-id='task id']");
stateDropDownArrow = element(by.css("mat-form-field[data-automation-id='state']"));
stateDropDownArrow = $("mat-form-field[data-automation-id='state']");
stateDropdown = new DropdownPage(this.stateDropDownArrow);
taskList(): TasksListPage {
@@ -97,7 +97,7 @@ export class TaskListDemoPage {
async getItemsPerPageFieldErrorMessage(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.itemsPerPageForm);
const errorMessage = this.itemsPerPageForm.element(by.css('mat-error'));
const errorMessage = this.itemsPerPageForm.$('mat-error');
return BrowserActions.getText(errorMessage);
}
@@ -111,7 +111,7 @@ export class TaskListDemoPage {
async getPageFieldErrorMessage(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.pageForm);
const errorMessage = this.pageForm.element(by.css('mat-error'));
const errorMessage = this.pageForm.$('mat-error');
return BrowserActions.getText(errorMessage);
}