fix flaky input controls functional test (#31970)

This commit is contained in:
Nathan Reese 2019-02-26 06:04:51 -07:00 committed by GitHub
parent 8fc9d90744
commit 946b7823f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,10 +62,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;