File tree Expand file tree Collapse file tree
src/plugins/unified_search/public/query_string_input Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export const AddFilterPopover = React.memo(function AddFilterPopover({
4747 iconType = "plusInCircleFilled"
4848 aria-label = { buttonIconLabel }
4949 data-test-subj = "addFilter"
50- onClick = { ( ) => setIsAddFilterPopoverOpen ( ! isAddFilterPopoverOpen ) }
50+ onClick = { ( ) => setIsAddFilterPopoverOpen ( ( isOpen ) => ! isOpen ) }
5151 size = "m"
5252 { ...buttonProps }
5353 />
@@ -63,6 +63,7 @@ export const AddFilterPopover = React.memo(function AddFilterPopover({
6363 closePopover = { ( ) => setIsAddFilterPopoverOpen ( false ) }
6464 anchorPosition = "downLeft"
6565 panelPaddingSize = "none"
66+ panelProps = { { 'data-test-subj' : 'addFilterPopover' } }
6667 initialFocus = ".filterEditor__hiddenItem"
6768 ownFocus
6869 repositionOnScroll
Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ export class FilterBarService extends FtrService {
128128 */
129129 public async addFilter ( field : string , operator : string , ...values : any ) : Promise < void > {
130130 await this . testSubjects . click ( 'addFilter' ) ;
131+ await this . testSubjects . existOrFail ( 'addFilterPopover' ) ;
131132 await this . comboBox . set ( 'filterFieldSuggestionList' , field ) ;
132133 await this . comboBox . set ( 'filterOperatorList' , operator ) ;
133134 const params = await this . testSubjects . find ( 'filterParams' ) ;
@@ -152,7 +153,9 @@ export class FilterBarService extends FtrService {
152153 }
153154 }
154155 }
155- await this . testSubjects . click ( 'saveFilter' ) ;
156+ await this . testSubjects . existOrFail ( 'addFilterPopover' ) ;
157+ await this . common . sleep ( 500 ) ; // Stale element errors occur without this wait
158+ await this . testSubjects . clickWhenNotDisabled ( 'saveFilter' ) ;
156159 await this . header . awaitGlobalLoadingIndicatorHidden ( ) ;
157160 }
158161
You can’t perform that action at this time.
0 commit comments