[APPS-2136] migrate search-datetime-range to date-fns (#9004)

* strongly typed forms

* migrate to date-fns

* [ci:force] mark moment pipes for deprecation

* [ci:force] try migrate the metadata smoke e2e

* [ci:force] remove dead code

* cleanup dead code and switch e2e to date-fns

* [ci:force] migrate tests

* revert metadata

* [ci:force] migrate e2e

* [ci:force] delete date util
This commit is contained in:
Denys Vuika
2023-10-18 07:56:10 +01:00
committed by GitHub
parent af24aceb65
commit 7d5fbecf3f
22 changed files with 350 additions and 428 deletions

View File

@@ -81,7 +81,7 @@ export class TaskDetailsPage {
return BrowserActions.getText(this.taskDetailsTitle);
}
async checkSelectedForm(formName): Promise<void> {
async checkSelectedForm(formName: string): Promise<void> {
await this.attachFormDropdown.checkOptionIsSelected(formName);
}
@@ -263,7 +263,7 @@ export class TaskDetailsPage {
await BrowserActions.clearSendKeys(this.addPeopleField, user);
}
async selectUserToInvolve(user): Promise<void> {
async selectUserToInvolve(user: string): Promise<void> {
const row = this.getRowsUser(user);
await BrowserActions.click(row);
}
@@ -282,15 +282,14 @@ export class TaskDetailsPage {
return $(`div[data-automation-id="adf-people-full-name-${user.replace(' ', '-')}"]`);
}
async removeInvolvedUser(user): Promise<void> {
async removeInvolvedUser(user: string): Promise<void> {
const row = this.getRowsUser(user).element(by.xpath('ancestor::adf-datatable-row[contains(@class, "adf-datatable-row")]'));
await BrowserActions.click(row.$('button[data-automation-id="action_menu_0"]'));
await BrowserVisibility.waitUntilElementIsVisible(this.removeInvolvedPeople);
await BrowserActions.click(this.removeInvolvedPeople);
}
async getInvolvedUserEmail(user): Promise<string> {
async getInvolvedUserEmail(user: string): Promise<string> {
return BrowserActions.getText($(`div[data-automation-id="adf-people-email-${user.replace(' ', '-')}"]`));
}
@@ -401,5 +400,4 @@ export class TaskDetailsPage {
await BrowserVisibility.waitUntilElementIsVisible(this.saveFormButton);
await BrowserActions.click(this.saveFormButton);
}
}

View File

@@ -21,12 +21,11 @@ import { TaskDetailsPage } from './task-details.page';
import { FiltersPage } from './filters.page';
import { ChecklistDialog } from './dialog/create-checklist-dialog.page';
import { TasksListPage } from './tasks-list.page';
import { element, by, $ } from 'protractor';
import { BrowserVisibility, BrowserActions, FormFields } from '@alfresco/adf-testing';
import { $, by, element } from 'protractor';
import { BrowserActions, BrowserVisibility, FormFields } from '@alfresco/adf-testing';
export class TasksPage {
createButton = $('button[data-automation-id="create-button"');
newTaskButton = $('button[data-automation-id="btn-start-task"]');
addChecklistButton = $('button[class*="adf-add-to-checklist-button"]');
rowByRowName = by.xpath('ancestor::mat-chip');
checklistContainer = $('div[class*="checklist-menu"]');
@@ -42,10 +41,10 @@ export class TasksPage {
return new StartTaskDialogPage();
}
async createTask({ name, description = '', dueDate = '', formName = 'None'}): Promise<void> {
async createTask({ name, description = '', dueDate = '', formName = 'None' }): Promise<void> {
await this.clickOnCreateButton();
await BrowserActions.clickExecuteScript('button[data-automation-id="btn-start-task"]');
const dialog = new StartTaskDialogPage();
const dialog = new StartTaskDialogPage();
await dialog.addName(name);
await dialog.addDescription(description);
await dialog.addDueDate(dueDate);
@@ -88,8 +87,7 @@ export class TasksPage {
getChecklistByName(name: string) {
const elem = this.getRowsName(name);
const row = elem.element(this.rowByRowName);
return row;
return elem.element(this.rowByRowName);
}
async checkChecklistIsDisplayed(name: string): Promise<void> {
@@ -150,5 +148,4 @@ export class TasksPage {
async clickSortByNameDesc(): Promise<any> {
return this.tasksListPage().getDataTable().sortByColumn('DESC', 'name');
}
}