Skip to content

Commit

Permalink
✏️ Improve fix comment context
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 committed Sep 28, 2020
1 parent 438febe commit c0d64ca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion x-pack/test/functional/page_objects/lens_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,16 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
await testSubjects.click('lns-newBucket-add');
const queryInput = await testSubjects.find('indexPattern-filters-queryStringInput');
await queryInput.type(queryString);
// Press Tab 2 twice instead of Enter to avoid race condition with the dropdown
// Problem here is that after typing in the queryInput a dropdown will fetch the server
// with suggestions and show up. Depending on the cursor position and some other factors
// pressing Enter at this point may lead to auto-complete the queryInput with random stuff from the
// dropdown which was not intended originally.
// To close the Filter popover we need to move to the label input and then press Enter:
// solution is to press Tab 2 twice (first Tab will close the dropdown) instead of Enter to avoid
// race condition with the dropdown
await PageObjects.common.pressTabKey();
await PageObjects.common.pressTabKey();
// Now it is safe to press Enter as we're in the label input
await PageObjects.common.pressEnterKey();
await PageObjects.common.sleep(1000); // give time for debounced components to rerender
},
Expand Down

0 comments on commit c0d64ca

Please sign in to comment.