mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3989] appname duplicated after switching between saved filters (#4395)
* C297646 - automated * linting fixes
This commit is contained in:
committed by
Eugenio Romano
parent
8b8f1e147f
commit
10699cb7b0
@@ -98,6 +98,32 @@ export class EditProcessFilterCloudComponent {
|
||||
Util.waitUntilElementIsVisible(this.selectedOption);
|
||||
}
|
||||
|
||||
setAppNameDropDown(option) {
|
||||
this.clickOnDropDownArrow('appName');
|
||||
|
||||
let appNameElement = element.all(by.cssContainingText('mat-option span', option)).first();
|
||||
Util.waitUntilElementIsClickable(appNameElement);
|
||||
Util.waitUntilElementIsVisible(appNameElement);
|
||||
appNameElement.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
async checkAppNamesAreUnique() {
|
||||
let appNameList = element.all(by.css('mat-option[data-automation-id="adf-cloud-edit-process-property-optionsappName"] span'));
|
||||
let appTextList = await appNameList.getText();
|
||||
let uniqueArray = appTextList.filter((appName) => {
|
||||
let sameAppNameArray = appTextList.filter((eachApp) => eachApp === appName);
|
||||
return sameAppNameArray.length === 1;
|
||||
});
|
||||
return uniqueArray.length === appTextList.length;
|
||||
}
|
||||
|
||||
getNumberOfAppNameOptions() {
|
||||
this.clickOnDropDownArrow('appName');
|
||||
let dropdownOptions = element.all(by.css('.mat-select-panel mat-option'));
|
||||
return dropdownOptions.count();
|
||||
}
|
||||
|
||||
setProcessInstanceId(option) {
|
||||
return this.setProperty('processInstanceId', option);
|
||||
}
|
||||
|
@@ -29,6 +29,7 @@ import { ProcessDefinitions } from '../actions/APS-cloud/process-definitions';
|
||||
import { ProcessInstances } from '../actions/APS-cloud/process-instances';
|
||||
import { Tasks } from '../actions/APS-cloud/tasks';
|
||||
import { Query } from '../actions/APS-cloud/query';
|
||||
import { browser, protractor } from 'protractor';
|
||||
|
||||
describe('Process list cloud', () => {
|
||||
|
||||
@@ -47,7 +48,7 @@ describe('Process list cloud', () => {
|
||||
const queryService: Query = new Query();
|
||||
|
||||
let silentLogin;
|
||||
let completedProcess;
|
||||
let completedProcess, runningProcessInstance, switchProcessInstance, noOfApps;
|
||||
const simpleApp = 'candidateuserapp';
|
||||
const user = TestConfig.adf.adminEmail, password = TestConfig.adf.adminPassword;
|
||||
|
||||
@@ -62,7 +63,7 @@ describe('Process list cloud', () => {
|
||||
configEditorPage.clickClearButton();
|
||||
configEditorPage.enterConfiguration('{' +
|
||||
'"properties": [' +
|
||||
'"state",' + '"processInstanceId",' + '"sort",' + '"order"' +
|
||||
'"appName",' + '"state",' + '"processInstanceId",' + '"sort",' + '"order"' +
|
||||
']' +
|
||||
'}');
|
||||
configEditorPage.clickSaveButton();
|
||||
@@ -71,6 +72,8 @@ describe('Process list cloud', () => {
|
||||
let processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp);
|
||||
await processInstancesService.init(user, password);
|
||||
await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp);
|
||||
runningProcessInstance = await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp);
|
||||
switchProcessInstance = await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp);
|
||||
|
||||
completedProcess = await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp);
|
||||
await queryService.init(user, password);
|
||||
@@ -148,6 +151,43 @@ describe('Process list cloud', () => {
|
||||
expect(processCloudDemoPage.editProcessFilterCloudComponent().getProcessInstanceId()).toEqual(completedProcess.entry.id);
|
||||
});
|
||||
|
||||
it('[C297646] Should display the filter dropdown fine , after switching between saved filters', async() => {
|
||||
|
||||
noOfApps = processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().getNumberOfAppNameOptions();
|
||||
expect(processCloudDemoPage.editProcessFilterCloudComponent().checkAppNamesAreUnique()).toBe(true);
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
processCloudDemoPage.editProcessFilterCloudComponent().setStateFilterDropDown('RUNNING')
|
||||
.setAppNameDropDown(simpleApp).setProcessInstanceId(runningProcessInstance.entry.id);
|
||||
|
||||
processCloudDemoPage.processListCloudComponent().getDataTable().checkSpinnerIsDisplayed().checkSpinnerIsNotDisplayed();
|
||||
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkContentIsDisplayed(runningProcessInstance.entry.id);
|
||||
expect(processCloudDemoPage.editProcessFilterCloudComponent().getNumberOfAppNameOptions()).toBe(noOfApps);
|
||||
expect(processCloudDemoPage.editProcessFilterCloudComponent().checkAppNamesAreUnique()).toBe(true);
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
|
||||
processCloudDemoPage.editProcessFilterCloudComponent().clickSaveAsButton();
|
||||
processCloudDemoPage.editProcessFilterCloudComponent().editProcessFilterDialog().setFilterName('SavedFilter').clickOnSaveButton();
|
||||
expect(processCloudDemoPage.getActiveFilterName()).toBe('SavedFilter');
|
||||
|
||||
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader();
|
||||
expect(processCloudDemoPage.editProcessFilterCloudComponent().getProcessInstanceId()).toEqual(runningProcessInstance.entry.id);
|
||||
|
||||
processCloudDemoPage.editProcessFilterCloudComponent().setStateFilterDropDown('RUNNING')
|
||||
.setAppNameDropDown(simpleApp).setProcessInstanceId(switchProcessInstance.entry.id);
|
||||
|
||||
processCloudDemoPage.processListCloudComponent().getDataTable().checkSpinnerIsDisplayed().checkSpinnerIsNotDisplayed();
|
||||
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkContentIsDisplayed(switchProcessInstance.entry.id);
|
||||
processCloudDemoPage.editProcessFilterCloudComponent().clickSaveAsButton();
|
||||
processCloudDemoPage.editProcessFilterCloudComponent().editProcessFilterDialog().setFilterName('SwitchFilter').clickOnSaveButton();
|
||||
expect(processCloudDemoPage.getActiveFilterName()).toBe('SwitchFilter');
|
||||
|
||||
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader();
|
||||
expect(processCloudDemoPage.editProcessFilterCloudComponent().getProcessInstanceId()).toEqual(switchProcessInstance.entry.id);
|
||||
expect(processCloudDemoPage.editProcessFilterCloudComponent().getNumberOfAppNameOptions()).toBe(noOfApps);
|
||||
expect(processCloudDemoPage.editProcessFilterCloudComponent().checkAppNamesAreUnique()).toBe(true);
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -22,89 +22,89 @@ export class ProcessListCloudConfiguration {
|
||||
|
||||
getConfiguration() {
|
||||
return {
|
||||
'presets': {
|
||||
'default': [
|
||||
{
|
||||
'key': 'entry.id',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.ID',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.name',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.NAME',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.status',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.STATUS',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.startDate',
|
||||
'type': 'date',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.START_DATE',
|
||||
'sortable': true,
|
||||
'format': 'timeAgo'
|
||||
},
|
||||
{
|
||||
'key': 'entry.appName',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.APP_NAME',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.businessKey',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.BUSINESS_KEY',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.description',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.DESCRIPTION',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.initiator',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.INITIATOR',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.lastModified',
|
||||
'type': 'date',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.LAST_MODIFIED',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.processName',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_NAME',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.processId',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_ID',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.processDefinitionId',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_DEFINITION_ID',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.processDefinitionKey',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_DEFINITION_KEY',
|
||||
'sortable': true
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
'presets': {
|
||||
'default': [
|
||||
{
|
||||
'key': 'entry.id',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.ID',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.name',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.NAME',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.status',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.STATUS',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.startDate',
|
||||
'type': 'date',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.START_DATE',
|
||||
'sortable': true,
|
||||
'format': 'timeAgo'
|
||||
},
|
||||
{
|
||||
'key': 'entry.appName',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.APP_NAME',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.businessKey',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.BUSINESS_KEY',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.description',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.DESCRIPTION',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.initiator',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.INITIATOR',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.lastModified',
|
||||
'type': 'date',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.LAST_MODIFIED',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.processName',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_NAME',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.processId',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_ID',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.processDefinitionId',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_DEFINITION_ID',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'entry.processDefinitionKey',
|
||||
'type': 'text',
|
||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_DEFINITION_KEY',
|
||||
'sortable': true
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user