mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3995]Implemented test cases for preserved value for process filter (#4353)
* Implemented test cases for preserved value for process filter * Update process-custom-filters.e2e.ts
This commit is contained in:
committed by
Eugenio Romano
parent
49edeb7468
commit
bfe046637a
@@ -69,4 +69,11 @@ export class ConfigEditorPage {
|
|||||||
Util.waitUntilElementIsClickable(button);
|
Util.waitUntilElementIsClickable(button);
|
||||||
return button.click();
|
return button.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clickEditProcessCloudConfiguration() {
|
||||||
|
let button = element(by.id('adf-edit-process-filter-conf'));
|
||||||
|
Util.waitUntilElementIsVisible(button);
|
||||||
|
Util.waitUntilElementIsClickable(button);
|
||||||
|
return button.click();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
82
e2e/pages/adf/dialog/editProcessFilterDialog.ts
Normal file
82
e2e/pages/adf/dialog/editProcessFilterDialog.ts
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2019 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { by, element } from 'protractor';
|
||||||
|
import { Util } from '../../../util/util';
|
||||||
|
|
||||||
|
export class EditProcessFilterDialog {
|
||||||
|
|
||||||
|
componentElement = element(by.css('adf-cloud-process-filter-dialog-cloud'));
|
||||||
|
title = element(by.id('adf-process-filter-dialog-title'));
|
||||||
|
filterNameInput = element(by.id('adf-filter-name-id'));
|
||||||
|
saveButtonLocator = by.id('adf-save-button-id');
|
||||||
|
cancelButtonLocator = by.id('adf-cancel-button-id');
|
||||||
|
|
||||||
|
clickOnSaveButton() {
|
||||||
|
let saveButton = this.componentElement.element(this.saveButtonLocator);
|
||||||
|
Util.waitUntilElementIsVisible(saveButton);
|
||||||
|
saveButton.click();
|
||||||
|
Util.waitUntilElementIsNotVisible(this.componentElement);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkSaveButtonIsEnabled() {
|
||||||
|
Util.waitUntilElementIsVisible(this.componentElement.element(this.saveButtonLocator));
|
||||||
|
return this.componentElement.element(this.saveButtonLocator).isEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnCancelButton() {
|
||||||
|
let cancelButton = this.componentElement.element(this.cancelButtonLocator);
|
||||||
|
Util.waitUntilElementIsVisible(cancelButton);
|
||||||
|
cancelButton.click();
|
||||||
|
Util.waitUntilElementIsNotVisible(this.componentElement);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkCancelButtonIsEnabled() {
|
||||||
|
Util.waitUntilElementIsVisible(this.componentElement.element(this.cancelButtonLocator));
|
||||||
|
return this.componentElement.element(this.cancelButtonLocator).isEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
getFilterName() {
|
||||||
|
Util.waitUntilElementIsVisible(this.filterNameInput);
|
||||||
|
return this.filterNameInput.getAttribute('value');
|
||||||
|
}
|
||||||
|
|
||||||
|
setFilterName(filterName) {
|
||||||
|
this.clearFilterName();
|
||||||
|
this.filterNameInput.sendKeys(filterName);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
clearFilterName() {
|
||||||
|
Util.waitUntilElementIsVisible(this.filterNameInput);
|
||||||
|
this.filterNameInput.click();
|
||||||
|
this.filterNameInput.getAttribute('value').then((value) => {
|
||||||
|
for (let i = value.length; i >= 0; i--) {
|
||||||
|
this.filterNameInput.sendKeys(protractor.Key.BACK_SPACE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getTitle() {
|
||||||
|
Util.waitUntilElementIsVisible(this.title);
|
||||||
|
return this.title.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -16,11 +16,19 @@
|
|||||||
*/
|
*/
|
||||||
import { Util } from '../../../util/util';
|
import { Util } from '../../../util/util';
|
||||||
import { by, element } from 'protractor';
|
import { by, element } from 'protractor';
|
||||||
|
import { EditProcessFilterDialog } from '../dialog/editProcessFilterDialog';
|
||||||
|
|
||||||
export class EditProcessFilterCloudComponent {
|
export class EditProcessFilterCloudComponent {
|
||||||
|
|
||||||
customiseFilter = element(by.id('adf-edit-process-filter-title-id'));
|
customiseFilter = element(by.id('adf-edit-process-filter-title-id'));
|
||||||
selectedOption = element(by.css('mat-option[class*="mat-selected"]'));
|
selectedOption = element(by.css('mat-option[class*="mat-selected"]'));
|
||||||
|
saveAsButton = element(by.css('button[id="adf-save-as-id"]'));
|
||||||
|
|
||||||
|
editProcessFilter = new EditProcessFilterDialog();
|
||||||
|
|
||||||
|
editProcessFilterDialog() {
|
||||||
|
return this.editProcessFilter;
|
||||||
|
}
|
||||||
|
|
||||||
clickCustomiseFilterHeader() {
|
clickCustomiseFilterHeader() {
|
||||||
Util.waitUntilElementIsVisible(this.customiseFilter);
|
Util.waitUntilElementIsVisible(this.customiseFilter);
|
||||||
@@ -59,9 +67,39 @@ export class EditProcessFilterCloudComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clickOnDropDownArrow(option) {
|
clickOnDropDownArrow(option) {
|
||||||
let dropDownArrow = element(by.css("mat-form-field[data-automation-id='" + option + "'] div[class*='arrow']"));
|
let dropDownArrow = element.all(by.css("mat-form-field[data-automation-id='" + option + "'] div[class*='arrow']")).first();
|
||||||
Util.waitUntilElementIsVisible(dropDownArrow);
|
Util.waitUntilElementIsVisible(dropDownArrow);
|
||||||
dropDownArrow.click();
|
dropDownArrow.click();
|
||||||
Util.waitUntilElementIsVisible(this.selectedOption);
|
Util.waitUntilElementIsVisible(this.selectedOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setProcessInstanceId(option) {
|
||||||
|
return this.setProperty('processInstanceId', option);
|
||||||
|
}
|
||||||
|
|
||||||
|
getProcessInstanceId() {
|
||||||
|
return this.getProperty('processInstanceId');
|
||||||
|
}
|
||||||
|
|
||||||
|
getProperty(property) {
|
||||||
|
let locator = element.all(by.css('input[data-automation-id="adf-cloud-edit-process-property-' + property + '"]')).first();
|
||||||
|
Util.waitUntilElementIsVisible(locator);
|
||||||
|
return locator.getAttribute('value');
|
||||||
|
}
|
||||||
|
|
||||||
|
setProperty(property, option) {
|
||||||
|
let locator = element.all(by.css('input[data-automation-id="adf-cloud-edit-process-property-' + property + '"]')).first();
|
||||||
|
Util.waitUntilElementIsVisible(locator);
|
||||||
|
locator.clear();
|
||||||
|
locator.sendKeys(option);
|
||||||
|
locator.sendKeys(protractor.Key.ENTER);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
clickSaveAsButton() {
|
||||||
|
Util.waitUntilElementIsClickable(this.saveAsButton);
|
||||||
|
Util.waitUntilElementIsVisible(this.saveAsButton);
|
||||||
|
this.saveAsButton.click();
|
||||||
|
return this.editProcessFilter;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -23,6 +23,7 @@ import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
|||||||
import { ProcessCloudDemoPage } from '../pages/adf/demo-shell/process-services/processCloudDemoPage';
|
import { ProcessCloudDemoPage } from '../pages/adf/demo-shell/process-services/processCloudDemoPage';
|
||||||
import { TasksCloudDemoPage } from '../pages/adf/demo-shell/process-services/tasksCloudDemoPage';
|
import { TasksCloudDemoPage } from '../pages/adf/demo-shell/process-services/tasksCloudDemoPage';
|
||||||
import { AppListCloudComponent } from '../pages/adf/process-cloud/appListCloudComponent';
|
import { AppListCloudComponent } from '../pages/adf/process-cloud/appListCloudComponent';
|
||||||
|
import { ConfigEditorPage } from '../pages/adf/configEditorPage';
|
||||||
|
|
||||||
import { ProcessDefinitions } from '../actions/APS-cloud/process-definitions';
|
import { ProcessDefinitions } from '../actions/APS-cloud/process-definitions';
|
||||||
import { ProcessInstances } from '../actions/APS-cloud/process-instances';
|
import { ProcessInstances } from '../actions/APS-cloud/process-instances';
|
||||||
@@ -32,6 +33,7 @@ import { Query } from '../actions/APS-cloud/query';
|
|||||||
describe('Process list cloud', () => {
|
describe('Process list cloud', () => {
|
||||||
|
|
||||||
describe('Process List', () => {
|
describe('Process List', () => {
|
||||||
|
const configEditorPage = new ConfigEditorPage();
|
||||||
const settingsPage = new SettingsPage();
|
const settingsPage = new SettingsPage();
|
||||||
const loginSSOPage = new LoginSSOPage();
|
const loginSSOPage = new LoginSSOPage();
|
||||||
const navigationBarPage = new NavigationBarPage();
|
const navigationBarPage = new NavigationBarPage();
|
||||||
@@ -55,6 +57,16 @@ describe('Process list cloud', () => {
|
|||||||
loginSSOPage.clickOnSSOButton();
|
loginSSOPage.clickOnSSOButton();
|
||||||
loginSSOPage.loginAPS(user, password);
|
loginSSOPage.loginAPS(user, password);
|
||||||
|
|
||||||
|
navigationBarPage.clickConfigEditorButton();
|
||||||
|
configEditorPage.clickEditProcessCloudConfiguration();
|
||||||
|
configEditorPage.clickClearButton();
|
||||||
|
configEditorPage.enterConfiguration('{' +
|
||||||
|
'"properties": [' +
|
||||||
|
'"state",' + '"processInstanceId",' + '"sort",' + '"order"' +
|
||||||
|
']' +
|
||||||
|
'}');
|
||||||
|
configEditorPage.clickSaveButton();
|
||||||
|
|
||||||
await processDefinitionService.init(user, password);
|
await processDefinitionService.init(user, password);
|
||||||
let processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp);
|
let processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp);
|
||||||
await processInstancesService.init(user, password);
|
await processInstancesService.init(user, password);
|
||||||
@@ -119,6 +131,23 @@ describe('Process list cloud', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('[C297697] The value of the filter should be preserved when saving it', async() => {
|
||||||
|
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader()
|
||||||
|
.setProcessInstanceId(completedProcess.entry.id);
|
||||||
|
|
||||||
|
processCloudDemoPage.processListCloudComponent().getDataTable().checkSpinnerIsDisplayed().checkSpinnerIsNotDisplayed();
|
||||||
|
|
||||||
|
expect(tasksCloudDemoPage.taskListCloudComponent().getDataTable().getAllDisplayedRows()).toBe(1);
|
||||||
|
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkContentIsDisplayed(completedProcess.entry.id);
|
||||||
|
|
||||||
|
processCloudDemoPage.editProcessFilterCloudComponent().clickSaveAsButton();
|
||||||
|
processCloudDemoPage.editProcessFilterCloudComponent().editProcessFilterDialog().setFilterName('New').clickOnSaveButton();
|
||||||
|
expect(processCloudDemoPage.getActiveFilterName()).toBe('New');
|
||||||
|
|
||||||
|
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader();
|
||||||
|
expect(processCloudDemoPage.editProcessFilterCloudComponent().getProcessInstanceId()).toEqual(completedProcess.entry.id);
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user