mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* 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:
parent
cb774024d1
commit
2747d5e848
2 changed files with 22 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue