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);
|
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) {
|
setProcessInstanceId(option) {
|
||||||
return this.setProperty('processInstanceId', 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 { ProcessInstances } from '../actions/APS-cloud/process-instances';
|
||||||
import { Tasks } from '../actions/APS-cloud/tasks';
|
import { Tasks } from '../actions/APS-cloud/tasks';
|
||||||
import { Query } from '../actions/APS-cloud/query';
|
import { Query } from '../actions/APS-cloud/query';
|
||||||
|
import { browser, protractor } from 'protractor';
|
||||||
|
|
||||||
describe('Process list cloud', () => {
|
describe('Process list cloud', () => {
|
||||||
|
|
||||||
@@ -47,7 +48,7 @@ describe('Process list cloud', () => {
|
|||||||
const queryService: Query = new Query();
|
const queryService: Query = new Query();
|
||||||
|
|
||||||
let silentLogin;
|
let silentLogin;
|
||||||
let completedProcess;
|
let completedProcess, runningProcessInstance, switchProcessInstance, noOfApps;
|
||||||
const simpleApp = 'candidateuserapp';
|
const simpleApp = 'candidateuserapp';
|
||||||
const user = TestConfig.adf.adminEmail, password = TestConfig.adf.adminPassword;
|
const user = TestConfig.adf.adminEmail, password = TestConfig.adf.adminPassword;
|
||||||
|
|
||||||
@@ -62,7 +63,7 @@ describe('Process list cloud', () => {
|
|||||||
configEditorPage.clickClearButton();
|
configEditorPage.clickClearButton();
|
||||||
configEditorPage.enterConfiguration('{' +
|
configEditorPage.enterConfiguration('{' +
|
||||||
'"properties": [' +
|
'"properties": [' +
|
||||||
'"state",' + '"processInstanceId",' + '"sort",' + '"order"' +
|
'"appName",' + '"state",' + '"processInstanceId",' + '"sort",' + '"order"' +
|
||||||
']' +
|
']' +
|
||||||
'}');
|
'}');
|
||||||
configEditorPage.clickSaveButton();
|
configEditorPage.clickSaveButton();
|
||||||
@@ -71,6 +72,8 @@ describe('Process list cloud', () => {
|
|||||||
let processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp);
|
let processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp);
|
||||||
await processInstancesService.init(user, password);
|
await processInstancesService.init(user, password);
|
||||||
await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp);
|
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);
|
completedProcess = await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp);
|
||||||
await queryService.init(user, password);
|
await queryService.init(user, password);
|
||||||
@@ -148,6 +151,43 @@ describe('Process list cloud', () => {
|
|||||||
expect(processCloudDemoPage.editProcessFilterCloudComponent().getProcessInstanceId()).toEqual(completedProcess.entry.id);
|
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() {
|
getConfiguration() {
|
||||||
return {
|
return {
|
||||||
'presets': {
|
'presets': {
|
||||||
'default': [
|
'default': [
|
||||||
{
|
{
|
||||||
'key': 'entry.id',
|
'key': 'entry.id',
|
||||||
'type': 'text',
|
'type': 'text',
|
||||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.ID',
|
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.ID',
|
||||||
'sortable': true
|
'sortable': true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'key': 'entry.name',
|
'key': 'entry.name',
|
||||||
'type': 'text',
|
'type': 'text',
|
||||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.NAME',
|
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.NAME',
|
||||||
'sortable': true
|
'sortable': true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'key': 'entry.status',
|
'key': 'entry.status',
|
||||||
'type': 'text',
|
'type': 'text',
|
||||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.STATUS',
|
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.STATUS',
|
||||||
'sortable': true
|
'sortable': true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'key': 'entry.startDate',
|
'key': 'entry.startDate',
|
||||||
'type': 'date',
|
'type': 'date',
|
||||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.START_DATE',
|
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.START_DATE',
|
||||||
'sortable': true,
|
'sortable': true,
|
||||||
'format': 'timeAgo'
|
'format': 'timeAgo'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'key': 'entry.appName',
|
'key': 'entry.appName',
|
||||||
'type': 'text',
|
'type': 'text',
|
||||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.APP_NAME',
|
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.APP_NAME',
|
||||||
'sortable': true
|
'sortable': true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'key': 'entry.businessKey',
|
'key': 'entry.businessKey',
|
||||||
'type': 'text',
|
'type': 'text',
|
||||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.BUSINESS_KEY',
|
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.BUSINESS_KEY',
|
||||||
'sortable': true
|
'sortable': true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'key': 'entry.description',
|
'key': 'entry.description',
|
||||||
'type': 'text',
|
'type': 'text',
|
||||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.DESCRIPTION',
|
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.DESCRIPTION',
|
||||||
'sortable': true
|
'sortable': true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'key': 'entry.initiator',
|
'key': 'entry.initiator',
|
||||||
'type': 'text',
|
'type': 'text',
|
||||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.INITIATOR',
|
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.INITIATOR',
|
||||||
'sortable': true
|
'sortable': true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'key': 'entry.lastModified',
|
'key': 'entry.lastModified',
|
||||||
'type': 'date',
|
'type': 'date',
|
||||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.LAST_MODIFIED',
|
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.LAST_MODIFIED',
|
||||||
'sortable': true
|
'sortable': true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'key': 'entry.processName',
|
'key': 'entry.processName',
|
||||||
'type': 'text',
|
'type': 'text',
|
||||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_NAME',
|
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_NAME',
|
||||||
'sortable': true
|
'sortable': true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'key': 'entry.processId',
|
'key': 'entry.processId',
|
||||||
'type': 'text',
|
'type': 'text',
|
||||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_ID',
|
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_ID',
|
||||||
'sortable': true
|
'sortable': true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'key': 'entry.processDefinitionId',
|
'key': 'entry.processDefinitionId',
|
||||||
'type': 'text',
|
'type': 'text',
|
||||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_DEFINITION_ID',
|
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_DEFINITION_ID',
|
||||||
'sortable': true
|
'sortable': true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'key': 'entry.processDefinitionKey',
|
'key': 'entry.processDefinitionKey',
|
||||||
'type': 'text',
|
'type': 'text',
|
||||||
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_DEFINITION_KEY',
|
'title': 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_DEFINITION_KEY',
|
||||||
'sortable': true
|
'sortable': true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user