mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
e2e: Improve cloud custom filters
* Improve cloud custom filters
This commit is contained in:
parent
bbbdcbdaa5
commit
12c3fec51a
@ -174,7 +174,9 @@ describe('Process filters cloud', () => {
|
||||
it('[C306889] Should be able to see "No process found" when using an app with no processes in the appName field', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setAppNameDropDown('subprocessapp');
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await editProcessFilter.setInitiator(`${testUser.firstName} ${testUser.lastName}`);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
|
||||
await expect(await processListPage.getDisplayedProcessListTitle()).toEqual('No Processes Found');
|
||||
});
|
||||
@ -191,9 +193,11 @@ describe('Process filters cloud', () => {
|
||||
it('[C311315] Should be able to filter by process definition id', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProperty('processDefinitionId', processDefinition.entry.id);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
|
||||
await editProcessFilter.setProperty('processDefinitionId', anotherProcessDefinition.entry.id);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
@ -203,11 +207,13 @@ describe('Process filters cloud', () => {
|
||||
await editProcessFilter.setProperty('processDefinitionKey', processDefinition.entry.key);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await editProcessFilter.setProcessName(runningProcessInstance.entry.name);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
|
||||
await editProcessFilter.setProcessName(anotherProcessInstance.entry.name);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await editProcessFilter.setProperty('processDefinitionKey', anotherProcessDefinition.entry.key);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
@ -124,7 +124,7 @@ describe('Process Task - Attach content file', () => {
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickRunningProcessesFilter();
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProcessName('upload process');
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.closeFilter();
|
||||
await expect(await processCloudDemoPage.processFilterCloudComponent.getActiveFilterName()).toBe(CONSTANTS.PROCESS_FILTERS.RUNNING);
|
||||
|
||||
await processList.checkContentIsDisplayedById(processInstance.entry.id);
|
||||
@ -160,7 +160,7 @@ describe('Process Task - Attach content file', () => {
|
||||
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProcessName('upload process');
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.closeFilter();
|
||||
|
||||
await expect(await processCloudDemoPage.processFilterCloudComponent.getActiveFilterName()).toBe(CONSTANTS.PROCESS_FILTERS.COMPLETED);
|
||||
await processList.checkContentIsDisplayedById(processInstance.entry.id);
|
||||
|
@ -264,8 +264,6 @@ describe('Start Task Form', () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProcessName(startEventFormProcess);
|
||||
|
||||
await browser.sleep(1000);
|
||||
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.checkContentIsDisplayedByName(startEventFormProcess);
|
||||
|
||||
|
@ -71,7 +71,6 @@ describe('Edit process filters cloud', () => {
|
||||
await processFilter.clickOnProcessFilters();
|
||||
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.checkHeaderIsExpanded();
|
||||
await processFilter.clickAllProcessesFilter();
|
||||
});
|
||||
|
||||
@ -119,16 +118,11 @@ describe('Edit process filters cloud', () => {
|
||||
|
||||
await expect(await processFilter.getActiveFilterName()).toBe('New');
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.checkHeaderIsExpanded();
|
||||
await editProcessFilter.setSortFilterDropDown('Process Name');
|
||||
await expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Process Name');
|
||||
await editProcessFilter.clickSaveButton();
|
||||
await editProcessFilter.openFilter();
|
||||
|
||||
await editProcessFilter.checkHeaderIsExpanded();
|
||||
|
||||
await browser.driver.sleep(1000);
|
||||
|
||||
await expect(await processFilter.getActiveFilterName()).toBe('New');
|
||||
await expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Process Name');
|
||||
await editProcessFilter.clickDeleteButton();
|
||||
@ -163,26 +157,19 @@ describe('Edit process filters cloud', () => {
|
||||
await processFilter.clickAllProcessesFilter();
|
||||
await expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.ALL);
|
||||
await expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Start Date');
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.closeFilter();
|
||||
});
|
||||
|
||||
it('[C291811] Save button of process filter dialog should be disabled when process name is empty', async () => {
|
||||
it('[C291811] Save button of process filter dialog should be disabled when process name is empty ', async () => {
|
||||
await editProcessFilter.setSortFilterDropDown('Id');
|
||||
await editProcessFilter.clickSaveAsButton();
|
||||
|
||||
const dialog = editProcessFilter.editProcessFilterDialog();
|
||||
await dialog.clearFilterName();
|
||||
|
||||
await expect(await dialog.getFilterName()).toEqual('');
|
||||
await expect(await dialog.checkSaveButtonIsEnabled()).toEqual(false);
|
||||
await expect(await dialog.checkCancelButtonIsEnabled()).toEqual(true);
|
||||
await dialog.clickOnCancelButton();
|
||||
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.checkHeaderIsExpanded();
|
||||
await editProcessFilter.setSortFilterDropDown('Start Date');
|
||||
await expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Start Date');
|
||||
await editProcessFilter.clickSaveButton();
|
||||
});
|
||||
|
||||
it('[C291809] Process filter dialog is displayed when clicking on Save As button', async () => {
|
||||
@ -192,9 +179,9 @@ describe('Edit process filters cloud', () => {
|
||||
const dialog = editProcessFilter.editProcessFilterDialog();
|
||||
|
||||
await expect(await dialog.checkCancelButtonIsEnabled()).toEqual(true);
|
||||
await expect(await dialog.checkSaveButtonIsEnabled()).toEqual(true);
|
||||
await expect(await dialog.checkSaveButtonIsEnabled()).toEqual(false);
|
||||
await expect(await dialog.getTitle()).toEqual('Save filter as');
|
||||
await expect(await dialog.getFilterName()).toEqual(PROCESSES.ALL);
|
||||
await expect(await dialog.getFilterName()).toEqual('');
|
||||
await dialog.clickOnCancelButton();
|
||||
});
|
||||
|
||||
|
@ -50,10 +50,6 @@ describe('Edit task filters cloud', () => {
|
||||
const completedTaskName = StringUtil.generateRandomString(),
|
||||
assignedTaskName = StringUtil.generateRandomString();
|
||||
|
||||
async function openFilter() {
|
||||
await editTaskFilter.openFilter();
|
||||
}
|
||||
|
||||
async function clickTaskFilter(name: string) {
|
||||
await taskFilter.clickTaskFilter(name);
|
||||
}
|
||||
@ -94,7 +90,7 @@ describe('Edit task filters cloud', () => {
|
||||
});
|
||||
|
||||
it('[C291785] All the filters property should be set up accordingly with the Query Param', async () => {
|
||||
await openFilter();
|
||||
await editTaskFilter.openFilter();
|
||||
await clickTaskFilter('my-tasks');
|
||||
await waitTillContentLoaded();
|
||||
|
||||
@ -116,14 +112,14 @@ describe('Edit task filters cloud', () => {
|
||||
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(assignedTaskName);
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTaskName);
|
||||
await openFilter();
|
||||
await editTaskFilter.closeFilter();
|
||||
});
|
||||
|
||||
it('[C306896] Delete Save and Save as actions should be displayed and disabled when clicking on default filter header', async () => {
|
||||
await clickTaskFilter('my-tasks');
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await openFilter();
|
||||
await editTaskFilter.openFilter();
|
||||
await clickTaskFilter('my-tasks');
|
||||
await waitTillContentLoaded();
|
||||
|
||||
@ -136,7 +132,7 @@ describe('Edit task filters cloud', () => {
|
||||
await expect(await editTaskFilter.checkSaveButtonIsEnabled()).toEqual(false);
|
||||
await expect(await editTaskFilter.checkSaveAsButtonIsEnabled()).toEqual(false);
|
||||
await expect(await editTaskFilter.checkDeleteButtonIsEnabled()).toEqual(false);
|
||||
await openFilter();
|
||||
await editTaskFilter.closeFilter();
|
||||
});
|
||||
|
||||
it('[C586756] Delete, Save and Save as actions should be displayed and enabled when clicking on custom filter header', async () => {
|
||||
@ -145,7 +141,7 @@ describe('Edit task filters cloud', () => {
|
||||
await clickTaskFilter('custom-new');
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await openFilter();
|
||||
await editTaskFilter.openFilter();
|
||||
await clickTaskFilter('custom-new');
|
||||
await waitTillContentLoaded();
|
||||
|
||||
@ -164,7 +160,7 @@ describe('Edit task filters cloud', () => {
|
||||
it('[C291795] New filter is added when clicking Save As button', async () => {
|
||||
await createNewCustomFilter('New');
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
await openFilter();
|
||||
await editTaskFilter.openFilter();
|
||||
await expect(await editTaskFilter.checkSaveButtonIsEnabled()).toEqual(false);
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
await expect(await editTaskFilter.checkSaveAsButtonIsEnabled()).toEqual(false);
|
||||
@ -197,7 +193,7 @@ describe('Edit task filters cloud', () => {
|
||||
await editTaskFilterDialog.clickOnSaveButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
await openFilter();
|
||||
await editTaskFilter.openFilter();
|
||||
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
await editTaskFilter.setSortFilterDropDown('priority');
|
||||
@ -206,13 +202,13 @@ describe('Edit task filters cloud', () => {
|
||||
await editTaskFilter.editTaskFilterDialog().clickOnSaveButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
await openFilter();
|
||||
await editTaskFilter.openFilter();
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('priority');
|
||||
await editTaskFilter.clickDeleteButton();
|
||||
await clickTaskFilter('custom-new');
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await openFilter();
|
||||
await editTaskFilter.openFilter();
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
await editTaskFilter.clickDeleteButton();
|
||||
});
|
||||
@ -234,11 +230,11 @@ describe('Edit task filters cloud', () => {
|
||||
await editTaskFilterDialog.clickOnSaveButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
await openFilter();
|
||||
await editTaskFilter.openFilter();
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
await editTaskFilter.setSortFilterDropDown('name');
|
||||
await editTaskFilter.clickSaveButton();
|
||||
await openFilter();
|
||||
await editTaskFilter.openFilter();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('name');
|
||||
@ -262,7 +258,7 @@ describe('Edit task filters cloud', () => {
|
||||
await editTaskFilterDialog.clickOnSaveButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
await openFilter();
|
||||
await editTaskFilter.openFilter();
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
await editTaskFilter.clickDeleteButton();
|
||||
|
||||
@ -294,12 +290,12 @@ describe('Edit task filters cloud', () => {
|
||||
await waitTillContentLoaded();
|
||||
await clickTaskFilter('my-tasks');
|
||||
await waitTillContentLoaded();
|
||||
await openFilter();
|
||||
await editTaskFilter.openFilter();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('createdDate');
|
||||
|
||||
await openFilter();
|
||||
await editTaskFilter.closeFilter();
|
||||
});
|
||||
|
||||
it('[C291801] Save button of task filter dialog should be disabled when task name is empty', async () => {
|
||||
|
@ -306,8 +306,6 @@ describe('Task form cloud component', () => {
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
await editTaskFilter.openFilter();
|
||||
|
||||
await browser.driver.sleep(1000);
|
||||
|
||||
await editTaskFilter.clearAssignee();
|
||||
await editTaskFilter.setStatusFilterDropDown('Created');
|
||||
|
||||
|
@ -266,13 +266,13 @@ describe('Task claim/release', () => {
|
||||
await editTaskFilter.setStatusFilterDropDown(status);
|
||||
|
||||
await editTaskFilter.setProcessInstanceId(processInstanceId);
|
||||
await editTaskFilter.openFilter();
|
||||
await editTaskFilter.closeFilter();
|
||||
}
|
||||
|
||||
async function setStatusStandaloneTaskFilter(status: StatusType) {
|
||||
await editTaskFilter.openFilter();
|
||||
await editTaskFilter.clearAssignee();
|
||||
await editTaskFilter.setStatusFilterDropDown(status);
|
||||
await editTaskFilter.openFilter();
|
||||
await editTaskFilter.closeFilter();
|
||||
}
|
||||
});
|
||||
|
@ -5,5 +5,8 @@
|
||||
"C279931": "login problem APS not basic",
|
||||
"C279930": "login problem APS not basic",
|
||||
"C269081": "https://alfresco.atlassian.net/browse/ADF-5385",
|
||||
"C272819": "https://alfresco.atlassian.net/browse/ADF-5385"
|
||||
"C272819": "https://alfresco.atlassian.net/browse/ADF-5385",
|
||||
"C290069": "https://alfresco.atlassian.net/browse/ADF-5387",
|
||||
"C291811": "https://alfresco.atlassian.net/browse/ADF-5405",
|
||||
"C291809": "https://alfresco.atlassian.net/browse/ADF-5405"
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ export interface FilterProps {
|
||||
|
||||
export class EditProcessFilterCloudComponentPage {
|
||||
|
||||
rootElement = element.all(by.css('adf-cloud-edit-process-filter')).first();
|
||||
customiseFilter = element(by.id('adf-edit-process-filter-sub-title-id'));
|
||||
saveButton = element(by.css('button[data-automation-id="adf-filter-action-save"]'));
|
||||
saveAsButton = element(by.css('button[data-automation-id="adf-filter-action-saveAs"]'));
|
||||
@ -43,6 +44,8 @@ export class EditProcessFilterCloudComponentPage {
|
||||
private locatorSortDropdown = element(by.css(`mat-select[data-automation-id='adf-cloud-edit-process-property-sort']`));
|
||||
private locatorOrderDropdown = element(by.css(`mat-select[data-automation-id='adf-cloud-edit-process-property-order']`));
|
||||
private locatorProcessDefinitionNameDropdown = element(by.css(`mat-select[data-automation-id='adf-cloud-edit-process-property-processDefinitionName']`));
|
||||
private expansionPanelExtended = this.rootElement.element(by.css('mat-expansion-panel-header.mat-expanded'));
|
||||
private content = this.rootElement.element(by.css('div.mat-expansion-panel-content[style*="visible"]'));
|
||||
|
||||
appNameDropdown = new DropdownPage(this.locatorAppNameDropdown);
|
||||
statusDropdown = new DropdownPage(this.locatorStatusDropdown);
|
||||
@ -62,22 +65,24 @@ export class EditProcessFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
async openFilter(): Promise<void> {
|
||||
await this.isFilterDisplayed();
|
||||
await BrowserActions.click(this.customiseFilter);
|
||||
await browser.driver.sleep(5000);
|
||||
}
|
||||
|
||||
async expandFilter(): Promise<void> {
|
||||
await this.isFilterDisplayed();
|
||||
await BrowserActions.click(this.customiseFilter);
|
||||
await this.checkHeaderIsExpanded();
|
||||
}
|
||||
|
||||
async checkHeaderIsExpanded(): Promise<void> {
|
||||
const expansionPanelExtended = element.all(by.css('mat-expansion-panel-header.mat-expanded')).first();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(expansionPanelExtended);
|
||||
const content = element.all(by.css('div.mat-expansion-panel-content[style*="visible"]')).first();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.expansionPanelExtended);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.content);
|
||||
}
|
||||
|
||||
async closeFilter(): Promise<void> {
|
||||
await BrowserActions.click(this.customiseFilter);
|
||||
await this.checkHeaderIsCollapsed();
|
||||
}
|
||||
|
||||
async checkHeaderIsCollapsed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.expansionPanelExtended, 1000);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.content, 1000);
|
||||
}
|
||||
|
||||
setStatusFilterDropDown(option: string): Promise<void> {
|
||||
@ -224,13 +229,13 @@ export class EditProcessFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
async setFilter(props: FilterProps): Promise<void> {
|
||||
await this.expandFilter();
|
||||
await this.openFilter();
|
||||
if (props.name) { await this.setProcessName(props.name); }
|
||||
if (props.status) { await this.setStatusFilterDropDown(props.status); }
|
||||
if (props.sort) { await this.setSortFilterDropDown(props.sort); }
|
||||
if (props.order) { await this.setOrderFilterDropDown(props.order); }
|
||||
if (props.initiator) { await this.setInitiator(props.initiator); }
|
||||
if (props.processName) { await this.setProcessName(props.processName); }
|
||||
await this.openFilter();
|
||||
await this.closeFilter();
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ export type StatusType = 'All' | 'Created' | 'Assigned' | 'Cancelled' | 'Suspend
|
||||
|
||||
export class EditTaskFilterCloudComponentPage {
|
||||
|
||||
rootElement = element.all(by.css('adf-cloud-edit-task-filter')).first();
|
||||
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('[data-automation-id="adf-cloud-edit-task-property-priority"]'));
|
||||
@ -50,6 +51,8 @@ export class EditTaskFilterCloudComponentPage {
|
||||
private locatorOrderDropdown = element(by.css(`mat-select[data-automation-id='adf-cloud-edit-task-property-order']`));
|
||||
private locatorCompletedDateDropdown = element(by.css(`mat-select[data-automation-id="adf-cloud-edit-process-property-completedDateRange"]`));
|
||||
private locatorAssignmentDropdown = element(by.css(`.adf-task-assignment-filter`));
|
||||
private expansionPanelExtended = this.rootElement.element(by.css('mat-expansion-panel-header.mat-expanded'));
|
||||
private content = this.rootElement.element(by.css('div.mat-expansion-panel-content[style*="visible"]'));
|
||||
|
||||
appNameDropdown = new DropdownPage(this.locatorAppNameDropdown);
|
||||
statusDropdown = new DropdownPage(this.locatorStatusDropdown);
|
||||
@ -74,21 +77,24 @@ export class EditTaskFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
async openFilter(): Promise<void> {
|
||||
await BrowserActions.click(this.customiseFilter);
|
||||
await browser.driver.sleep(1000);
|
||||
}
|
||||
|
||||
async expandFilter(): Promise<void> {
|
||||
await this.isFilterDisplayed();
|
||||
await BrowserActions.click(this.customiseFilter);
|
||||
await this.checkHeaderIsExpanded();
|
||||
}
|
||||
|
||||
async closeFilter(): Promise<void> {
|
||||
await BrowserActions.click(this.customiseFilter);
|
||||
await this.checkHeaderIsCollapsed();
|
||||
}
|
||||
|
||||
async checkHeaderIsExpanded(): Promise<void> {
|
||||
const expansionPanelExtended = element.all(by.css('mat-expansion-panel-header.mat-expanded')).first();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(expansionPanelExtended);
|
||||
const content = element.all(by.css('div.mat-expansion-panel-content[style*="visible"]')).first();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.expansionPanelExtended);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.content);
|
||||
}
|
||||
|
||||
async checkHeaderIsCollapsed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.expansionPanelExtended, 1000);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.content, 1000);
|
||||
}
|
||||
|
||||
async setStatusFilterDropDown(option: StatusType): Promise<void> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user