Skip to content

Commit

Permalink
fix flaky input controls functional test (#31970) (#32013)
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese authored Feb 26, 2019
1 parent 7660ee0 commit cf12d4b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/functional/services/combo_box.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,15 @@ export function ComboBoxProvider({ getService }) {
async getOptionsList(comboBoxSelector) {
log.debug(`comboBox.getOptionsList, comboBoxSelector: ${comboBoxSelector}`);
const comboBox = await testSubjects.find(comboBoxSelector);
await testSubjects.click(comboBoxSelector);
await this._waitForOptionsListLoading(comboBox);
const menu = await retry.try(
async () => await testSubjects.find('comboBoxOptionsList'));
const menu = await retry.try(async () => {
await testSubjects.click(comboBoxSelector);
await this._waitForOptionsListLoading(comboBox);
const isOptionsListOpen = await testSubjects.exists('comboBoxOptionsList');
if (!isOptionsListOpen) {
throw new Error('Combo box options list did not open on click');
}
return await testSubjects.find('comboBoxOptionsList');
});
const optionsText = await menu.getVisibleText();
await this.closeOptionsList(comboBox);
return optionsText;
Expand Down

0 comments on commit cf12d4b

Please sign in to comment.