Skip to content

Commit c0d64ca

Browse files
committed
✏️ Improve fix comment context
1 parent 438febe commit c0d64ca

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

x-pack/test/functional/page_objects/lens_page.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,16 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
132132
await testSubjects.click('lns-newBucket-add');
133133
const queryInput = await testSubjects.find('indexPattern-filters-queryStringInput');
134134
await queryInput.type(queryString);
135-
// Press Tab 2 twice instead of Enter to avoid race condition with the dropdown
135+
// Problem here is that after typing in the queryInput a dropdown will fetch the server
136+
// with suggestions and show up. Depending on the cursor position and some other factors
137+
// pressing Enter at this point may lead to auto-complete the queryInput with random stuff from the
138+
// dropdown which was not intended originally.
139+
// To close the Filter popover we need to move to the label input and then press Enter:
140+
// solution is to press Tab 2 twice (first Tab will close the dropdown) instead of Enter to avoid
141+
// race condition with the dropdown
136142
await PageObjects.common.pressTabKey();
137143
await PageObjects.common.pressTabKey();
144+
// Now it is safe to press Enter as we're in the label input
138145
await PageObjects.common.pressEnterKey();
139146
await PageObjects.common.sleep(1000); // give time for debounced components to rerender
140147
},

0 commit comments

Comments
 (0)