fix flaky input control chained test (#20642) (#20886)

* add check that combobox was successfully cleared

* run test 25 times

* checkin the correct files this time

* re-enable skipped test

* remove extra test loaders
This commit is contained in:
Nathan Reese 2018-07-17 11:24:26 -06:00 committed by GitHub
parent cb774024d1
commit 2747d5e848
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 3 deletions

View file

@ -275,7 +275,7 @@ export default function ({ getService, getPageObjects }) {
expect(hasChildControlFilter).to.equal(true);
});
it.skip('should clear child control dropdown when parent control value is removed', async () => {
it('should clear child control dropdown when parent control value is removed', async () => {
await PageObjects.visualize.clearComboBox('listControlSelect0');
await PageObjects.common.sleep(500); // give time for filter to be removed and event handlers to fire

View file

@ -284,12 +284,31 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
}
async clearComboBox(comboBoxSelector) {
log.debug(`clearComboBox for comboBoxSelector:${comboBoxSelector}`);
const comboBox = await testSubjects.find(comboBoxSelector);
const clearBtn = await comboBox.findByCssSelector('[data-test-subj="comboBoxClearButton"]');
await clearBtn.click();
await retry.try(async () => {
const clearButtonExists = await this.doesComboBoxClearButtonExist(comboBox);
if (!clearButtonExists) {
log.debug('Unable to clear comboBox, comboBoxClearButton does not exist');
return;
}
const clearBtn = await comboBox.findByCssSelector('[data-test-subj="comboBoxClearButton"]');
await clearBtn.click();
const clearButtonStillExists = await this.doesComboBoxClearButtonExist(comboBox);
if (clearButtonStillExists) {
throw new Error('Failed to clear comboBox');
}
});
await this.closeComboBoxOptionsList(comboBox);
}
async doesComboBoxClearButtonExist(comboBoxElement) {
return await find.exists(
async () => await comboBoxElement.findByCssSelector('[data-test-subj="comboBoxClearButton"]'));
}
async closeComboBoxOptionsList(comboBoxElement) {
const isOptionsListOpen = await testSubjects.exists('comboBoxOptionsList');
if (isOptionsListOpen) {