Skip to content

Commit

Permalink
[ACA-4458]Add expand cloud custom filter method
Browse files Browse the repository at this point in the history
* [ACA-4458]Add expand cloud custom filter method

* Fix comment

* Rename method

* Fix comment

* Fix comment
  • Loading branch information
cristinaj authored May 20, 2021
1 parent 6e0ad4c commit a5e85b4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('Edit process filters cloud', () => {
await processFilter.clickOnProcessFilters();

await editProcessFilter.openFilter();
await editProcessFilter.checkCustomiseFilterHeaderIsExpanded();
await editProcessFilter.checkHeaderIsExpanded();
await processFilter.clickAllProcessesFilter();
});

Expand Down Expand Up @@ -119,13 +119,13 @@ describe('Edit process filters cloud', () => {

await expect(await processFilter.getActiveFilterName()).toBe('New');
await editProcessFilter.openFilter();
await editProcessFilter.checkCustomiseFilterHeaderIsExpanded();
await editProcessFilter.checkHeaderIsExpanded();
await editProcessFilter.setSortFilterDropDown('Process Name');
await expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Process Name');
await editProcessFilter.clickSaveButton();
await editProcessFilter.openFilter();

await editProcessFilter.checkCustomiseFilterHeaderIsExpanded();
await editProcessFilter.checkHeaderIsExpanded();

await browser.driver.sleep(1000);

Expand Down Expand Up @@ -179,7 +179,7 @@ describe('Edit process filters cloud', () => {
await dialog.clickOnCancelButton();

await editProcessFilter.openFilter();
await editProcessFilter.checkCustomiseFilterHeaderIsExpanded();
await editProcessFilter.checkHeaderIsExpanded();
await editProcessFilter.setSortFilterDropDown('Start Date');
await expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Start Date');
await editProcessFilter.clickSaveButton();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,16 @@ export class EditProcessFilterCloudComponentPage {
await browser.driver.sleep(5000);
}

async checkCustomiseFilterHeaderIsExpanded(): Promise<void> {
const expansionPanelExtended = element.all(by.css('mat-expansion-panel-header[class*="mat-expanded"]')).first();
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[class*="mat-expansion-panel-content "][style*="visible"]')).first();
const content = element.all(by.css('div.mat-expansion-panel-content[style*="visible"]')).first();
await BrowserVisibility.waitUntilElementIsVisible(content);
}

Expand Down Expand Up @@ -218,7 +224,7 @@ export class EditProcessFilterCloudComponentPage {
}

async setFilter(props: FilterProps): Promise<void> {
await this.openFilter();
await this.expandFilter();
if (props.name) { await this.setProcessName(props.name); }
if (props.status) { await this.setStatusFilterDropDown(props.status); }
if (props.sort) { await this.setSortFilterDropDown(props.sort); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,19 @@ export class EditTaskFilterCloudComponentPage {
await browser.driver.sleep(1000);
}

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);
}

async setStatusFilterDropDown(option: StatusType): Promise<void> {
await this.statusDropdown.selectDropdownOption(option);
await this.dataTable.waitTillContentLoaded();
Expand Down

0 comments on commit a5e85b4

Please sign in to comment.