Skip to content

Commit

Permalink
Fix FTR Add/Save Filter failures
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Aug 9, 2022
1 parent 0c42a27 commit d279fd6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const AddFilterPopover = React.memo(function AddFilterPopover({
iconType="plusInCircleFilled"
aria-label={buttonIconLabel}
data-test-subj="addFilter"
onClick={() => setIsAddFilterPopoverOpen(!isAddFilterPopoverOpen)}
onClick={() => setIsAddFilterPopoverOpen((isOpen) => !isOpen)}
size="m"
{...buttonProps}
/>
Expand All @@ -63,6 +63,7 @@ export const AddFilterPopover = React.memo(function AddFilterPopover({
closePopover={() => setIsAddFilterPopoverOpen(false)}
anchorPosition="downLeft"
panelPaddingSize="none"
panelProps={{ 'data-test-subj': 'addFilterPopover' }}
initialFocus=".filterEditor__hiddenItem"
ownFocus
repositionOnScroll
Expand Down
5 changes: 4 additions & 1 deletion test/functional/services/filter_bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export class FilterBarService extends FtrService {
*/
public async addFilter(field: string, operator: string, ...values: any): Promise<void> {
await this.testSubjects.click('addFilter');
await this.testSubjects.existOrFail('addFilterPopover');
await this.comboBox.set('filterFieldSuggestionList', field);
await this.comboBox.set('filterOperatorList', operator);
const params = await this.testSubjects.find('filterParams');
Expand All @@ -152,7 +153,9 @@ export class FilterBarService extends FtrService {
}
}
}
await this.testSubjects.click('saveFilter');
await this.testSubjects.existOrFail('addFilterPopover');
await this.common.sleep(500); // Stale element errors occur without this wait
await this.testSubjects.clickWhenNotDisabled('saveFilter');
await this.header.awaitGlobalLoadingIndicatorHidden();
}

Expand Down

0 comments on commit d279fd6

Please sign in to comment.