AAE-19551 e2e material locators refactor (#9403)

* AAE-19551 e2e-material-locators-refactor

* testing lib

* e2e lib

* playwright refactor

* fix lint issues

* bring back excluded process e2e

* fix spinner

* locator fixes
This commit is contained in:
Rafal Szmit
2024-03-07 19:33:03 +01:00
committed by GitHub
parent 75f33b1990
commit b8e62534bf
70 changed files with 764 additions and 239 deletions

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { BrowserActions, BrowserVisibility, DropdownPage, PaginationPage } from '@alfresco/adf-testing';
import { BrowserActions, BrowserVisibility, DropdownPage, PaginationPage, materialLocators } from '@alfresco/adf-testing';
import { $ } from 'protractor';
import { TasksListPage } from './tasks-list.page';
@@ -24,18 +24,18 @@ export class TaskListDemoPage {
taskListPage = new TasksListPage();
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\']');
itemsPerPageForm = $(`${materialLocators.Form.field.root}[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\']');
pageForm = $(`${materialLocators.Form.field.root}[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 = $('mat-form-field[data-automation-id=\'state\']');
stateDropDownArrow = $(`${materialLocators.Form.field.root}[data-automation-id=\'state\']`);
stateDropdown = new DropdownPage(this.stateDropDownArrow);
taskList(): TasksListPage {
@@ -93,7 +93,7 @@ export class TaskListDemoPage {
async getItemsPerPageFieldErrorMessage(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.itemsPerPageForm);
const errorMessage = this.itemsPerPageForm.$('mat-error');
const errorMessage = this.itemsPerPageForm.$(materialLocators.Error.root);
return BrowserActions.getText(errorMessage);
}
@@ -103,7 +103,7 @@ export class TaskListDemoPage {
async getPageFieldErrorMessage(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.pageForm);
const errorMessage = this.pageForm.$('mat-error');
const errorMessage = this.pageForm.$(materialLocators.Error.root);
return BrowserActions.getText(errorMessage);
}