mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-3992] Process Filter bug fixes and improvements (#6599)
* bug fixes * bug fixes * bug fixes * cleanup tests * travis workaround * travis workaround * travis workaround * travis workaround * travis workaround * travis workaround * Revert "travis workaround" This reverts commit b67efccfb0aab8c7f6b9235d01525487771b8123. * Revert "travis workaround" This reverts commit 448f4e6d1211771e914f35183860af6df3452c16. * Revert "travis workaround" This reverts commit 542fae649c0501a9150ccac2e5a2cd54ee39a690. * Revert "travis workaround" This reverts commit 12f58568fbb0f8d2defb4c21a3ab1683bc8aa312. * Revert "travis workaround" This reverts commit b0ffef3bee0f81faf6088be8b5c2b072ad2762e7. * Revert "travis workaround" This reverts commit c6d95a2ff3b38b543fea83d3fc53016ac657b3bb. * service fixes * remove junk tests * code fixes * reduce code complexity * update e2e * update e2e * fix i18n * e2e fixes * bug fixes * rebase and fix * properly serialize query params * rework process filters demo * remove dead code * code fixes * code fixes * e2e improvements * fix bug and remove e2e testing a bug * bug fixes for date ranges * fix e2e * fix unit test * reusable code * fix flaky e2e * fix angular cli version * remove useless e2e (already tested by unit tests) * remove useless e2e (already tested by unit tests) * demo shell fixes * remove fit * disable flaky test * update code as per review suggestions * fix after rebase * fix after rebase
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { EditProcessFilterDialogPage } from './dialog/edit-process-filter-dialog.page';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
@@ -57,11 +57,12 @@ export class EditProcessFilterCloudComponentPage {
|
||||
return this.editProcessFilterDialogPage;
|
||||
}
|
||||
|
||||
async isFilterDisplayed(): Promise<boolean> {
|
||||
isFilterDisplayed(): Promise<boolean> {
|
||||
return BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
}
|
||||
|
||||
async openFilter(): Promise<void> {
|
||||
await this.isFilterDisplayed();
|
||||
await BrowserActions.click(this.customiseFilter);
|
||||
await browser.driver.sleep(1000);
|
||||
}
|
||||
@@ -73,16 +74,16 @@ export class EditProcessFilterCloudComponentPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(content);
|
||||
}
|
||||
|
||||
async setStatusFilterDropDown(option: string): Promise<void> {
|
||||
await this.statusDropdown.selectDropdownOption(option);
|
||||
setStatusFilterDropDown(option: string): Promise<void> {
|
||||
return this.statusDropdown.selectDropdownOption(option);
|
||||
}
|
||||
|
||||
async getStateFilterDropDownValue(): Promise<string> {
|
||||
getStateFilterDropDownValue(): Promise<string> {
|
||||
return BrowserActions.getText(element(by.css("mat-form-field[data-automation-id='status'] span")));
|
||||
}
|
||||
|
||||
async setSortFilterDropDown(option): Promise<void> {
|
||||
await this.sortDropdown.selectDropdownOption(option);
|
||||
setSortFilterDropDown(option): Promise<void> {
|
||||
return this.sortDropdown.selectDropdownOption(option);
|
||||
}
|
||||
|
||||
async getSortFilterDropDownValue(): Promise<string> {
|
||||
@@ -95,16 +96,16 @@ export class EditProcessFilterCloudComponentPage {
|
||||
await browser.sleep(1500);
|
||||
}
|
||||
|
||||
async getOrderFilterDropDownValue(): Promise<string> {
|
||||
getOrderFilterDropDownValue(): Promise<string> {
|
||||
return BrowserActions.getText(element(by.css("mat-form-field[data-automation-id='order'] span")));
|
||||
}
|
||||
|
||||
async setAppNameDropDown(option: string): Promise<void> {
|
||||
await this.appNameDropdown.selectDropdownOption(option);
|
||||
setAppNameDropDown(option: string): Promise<void> {
|
||||
return this.appNameDropdown.selectDropdownOption(option);
|
||||
}
|
||||
|
||||
async setProcessDefinitionNameDropDown(option: string): Promise<void> {
|
||||
await this.processDefinitionNameDropdown.selectDropdownOption(option);
|
||||
setProcessDefinitionNameDropDown(option: string): Promise<void> {
|
||||
return this.processDefinitionNameDropdown.selectDropdownOption(option);
|
||||
}
|
||||
|
||||
async getApplicationSelected(): Promise<string> {
|
||||
@@ -127,28 +128,28 @@ export class EditProcessFilterCloudComponentPage {
|
||||
return this.appNameDropdown.getNumberOfOptions();
|
||||
}
|
||||
|
||||
async isApplicationListLoaded(): Promise<boolean> {
|
||||
isApplicationListLoaded(): Promise<boolean> {
|
||||
const emptyList = element(by.css(`[data-automation-id='adf-cloud-edit-process-property-appName'] .mat-select-placeholder`));
|
||||
return BrowserVisibility.waitUntilElementIsNotVisible(emptyList);
|
||||
}
|
||||
|
||||
async setProcessInstanceId(option: string): Promise<void> {
|
||||
await this.setProperty('processInstanceId', option);
|
||||
setProcessInstanceId(option: string): Promise<void> {
|
||||
return this.setProperty('processInstanceId', option);
|
||||
}
|
||||
|
||||
async setProcessDefinitionKey(option: string): Promise<void> {
|
||||
await this.setProperty('processDefinitionKey', option);
|
||||
setProcessDefinitionKey(option: string): Promise<void> {
|
||||
return this.setProperty('processDefinitionKey', option);
|
||||
}
|
||||
|
||||
async setProcessName(option: string): Promise<void> {
|
||||
await this.setProperty('processName', option);
|
||||
setProcessName(option: string): Promise<void> {
|
||||
return this.setProperty('processName', option);
|
||||
}
|
||||
|
||||
async setInitiator(value: string): Promise<void> {
|
||||
await this.peopleCloudComponent.searchAssigneeAndSelect(value);
|
||||
setInitiator(value: string): Promise<void> {
|
||||
return this.peopleCloudComponent.searchAssigneeAndSelect(value);
|
||||
}
|
||||
|
||||
async getProcessInstanceId(): Promise<string> {
|
||||
getProcessInstanceId(): Promise<string> {
|
||||
return this.getProperty('processInstanceId');
|
||||
}
|
||||
|
||||
@@ -161,25 +162,23 @@ export class EditProcessFilterCloudComponentPage {
|
||||
async setProperty(property: string, option: string): Promise<void> {
|
||||
const locator = element.all(by.css('input[data-automation-id="adf-cloud-edit-process-property-' + property + '"]')).first();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(locator);
|
||||
await locator.clear();
|
||||
await locator.sendKeys(option);
|
||||
await locator.sendKeys(protractor.Key.ENTER);
|
||||
await BrowserActions.clearSendKeys(locator, option);
|
||||
}
|
||||
|
||||
async checkSaveButtonIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.saveButton);
|
||||
checkSaveButtonIsDisplayed(): Promise<void> {
|
||||
return BrowserVisibility.waitUntilElementIsVisible(this.saveButton);
|
||||
}
|
||||
|
||||
async checkSaveAsButtonIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.saveAsButton);
|
||||
checkSaveAsButtonIsDisplayed(): Promise<void> {
|
||||
return BrowserVisibility.waitUntilElementIsVisible(this.saveAsButton);
|
||||
}
|
||||
|
||||
async checkDeleteButtonIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.deleteButton);
|
||||
checkDeleteButtonIsDisplayed(): Promise<void> {
|
||||
return BrowserVisibility.waitUntilElementIsVisible(this.deleteButton);
|
||||
}
|
||||
|
||||
async checkDeleteButtonIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.deleteButton);
|
||||
checkDeleteButtonIsNotDisplayed(): Promise<void> {
|
||||
return BrowserVisibility.waitUntilElementIsNotVisible(this.deleteButton);
|
||||
}
|
||||
|
||||
async checkSaveButtonIsEnabled(): Promise<boolean> {
|
||||
@@ -197,21 +196,25 @@ export class EditProcessFilterCloudComponentPage {
|
||||
return this.deleteButton.isEnabled();
|
||||
}
|
||||
|
||||
async saveAs(name: string): Promise<void> {
|
||||
await this.clickSaveAsButton();
|
||||
await this.editProcessFilterDialog().setFilterName(name);
|
||||
await this.editProcessFilterDialog().clickOnSaveButton();
|
||||
|
||||
await browser.driver.sleep(1000);
|
||||
}
|
||||
|
||||
async clickSaveAsButton(): Promise<void> {
|
||||
const disabledButton = element(by.css(("button[data-automation-id='adf-filter-action-saveAs'][disabled]")));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(disabledButton);
|
||||
await BrowserActions.click(this.saveAsButton);
|
||||
await browser.driver.sleep(1000);
|
||||
}
|
||||
|
||||
async clickDeleteButton(): Promise<void> {
|
||||
await BrowserActions.click(this.deleteButton);
|
||||
clickDeleteButton(): Promise<void> {
|
||||
return BrowserActions.click(this.deleteButton);
|
||||
}
|
||||
|
||||
async clickSaveButton(): Promise<void> {
|
||||
const disabledButton = element(by.css(("button[id='adf-save-as-id'][disabled]")));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(disabledButton);
|
||||
await BrowserActions.click(this.saveButton);
|
||||
clickSaveButton(): Promise<void> {
|
||||
return BrowserActions.click(this.saveButton);
|
||||
}
|
||||
|
||||
async setFilter(props: FilterProps): Promise<void> {
|
||||
|
@@ -191,8 +191,6 @@ export class EditTaskFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
async clickSaveAsButton(): Promise<void> {
|
||||
const disabledButton = element(by.css(("button[data-automation-id='adf-filter-action-saveAs'][disabled]")));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(disabledButton);
|
||||
await BrowserActions.click(this.saveAsButton);
|
||||
await browser.driver.sleep(1000);
|
||||
}
|
||||
|
@@ -19,9 +19,14 @@ import { Locator, by, element, ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
const FILTERS = {
|
||||
ALL: 'all-processes',
|
||||
COMPLETED: 'completed-processes',
|
||||
RUNNING: 'running-processes'
|
||||
};
|
||||
|
||||
export class ProcessFiltersCloudComponentPage {
|
||||
|
||||
filter: ElementFinder;
|
||||
filterIcon: Locator = by.css('adf-icon[data-automation-id="adf-filter-icon"]');
|
||||
|
||||
processFilters = element(by.css("mat-expansion-panel[data-automation-id='Process Filters']"));
|
||||
@@ -30,62 +35,48 @@ export class ProcessFiltersCloudComponentPage {
|
||||
processFiltersList = element(by.css('adf-cloud-process-filters'));
|
||||
|
||||
async checkProcessFilterIsDisplayed(filterName: string): Promise<void> {
|
||||
this.filter = this.getProcessFilterLocatorByFilterName(filterName);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
}
|
||||
|
||||
async getProcessFilterIcon(filterName: string): Promise<string> {
|
||||
this.filter = this.getProcessFilterLocatorByFilterName(filterName);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
const icon = this.filter.element(this.filterIcon);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(icon);
|
||||
return BrowserActions.getText(icon);
|
||||
}
|
||||
|
||||
async checkProcessFilterHasNoIcon(filterName: string): Promise<void> {
|
||||
this.filter = this.getProcessFilterLocatorByFilterName(filterName);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.filterIcon));
|
||||
const filter = this.getProcessFilterLocatorByFilterName(filterName);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(filter);
|
||||
}
|
||||
|
||||
async clickProcessFilter(filterName: string): Promise<void> {
|
||||
this.filter = this.getProcessFilterLocatorByFilterName(filterName);
|
||||
await BrowserActions.click(this.filter);
|
||||
const filter = this.getProcessFilterLocatorByFilterName(filterName);
|
||||
await BrowserActions.click(filter);
|
||||
}
|
||||
|
||||
async clickAllProcessesFilter(): Promise<void> {
|
||||
this.filter = this.getProcessFilterLocatorByFilterName('all-processes');
|
||||
await BrowserActions.click(this.filter);
|
||||
const filter = this.getProcessFilterLocatorByFilterName(FILTERS.ALL);
|
||||
await BrowserActions.click(filter);
|
||||
}
|
||||
|
||||
async clickCompletedProcessesFilter(): Promise<void> {
|
||||
this.filter = this.getProcessFilterLocatorByFilterName('completed-processes');
|
||||
await BrowserActions.click(this.filter);
|
||||
const filter = this.getProcessFilterLocatorByFilterName(FILTERS.COMPLETED);
|
||||
await BrowserActions.click(filter);
|
||||
}
|
||||
|
||||
async clickRunningProcessesFilter(): Promise<void> {
|
||||
this.filter = this.getProcessFilterLocatorByFilterName('running-processes');
|
||||
await BrowserActions.click(this.filter);
|
||||
const filter = this.getProcessFilterLocatorByFilterName(FILTERS.RUNNING);
|
||||
await BrowserActions.click(filter);
|
||||
}
|
||||
|
||||
async checkAllProcessesFilterIsDisplayed(): Promise<void> {
|
||||
this.filter = this.getProcessFilterLocatorByFilterName('all-processes');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
const filter = this.getProcessFilterLocatorByFilterName(FILTERS.ALL);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(filter);
|
||||
}
|
||||
|
||||
async checkCompletedProcessesFilterIsDisplayed(): Promise<void> {
|
||||
this.filter = this.getProcessFilterLocatorByFilterName('completed-processes');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
const filter = this.getProcessFilterLocatorByFilterName(FILTERS.COMPLETED);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(filter);
|
||||
}
|
||||
|
||||
async checkRunningProcessesFilterIsDisplayed(): Promise<void> {
|
||||
this.filter = this.getProcessFilterLocatorByFilterName('running-processes');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
const filter = this.getProcessFilterLocatorByFilterName(FILTERS.RUNNING);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(filter);
|
||||
}
|
||||
|
||||
async checkProcessFilterNotDisplayed(filterName: string): Promise<void> {
|
||||
this.filter = this.getProcessFilterLocatorByFilterName(filterName);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter);
|
||||
const filter = this.getProcessFilterLocatorByFilterName(filterName);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(filter);
|
||||
}
|
||||
|
||||
async clickOnProcessFilters(): Promise<void> {
|
||||
|
Reference in New Issue
Block a user