Skip to content

Commit

Permalink
[Discover] Fix flaky autorefresh test
Browse files Browse the repository at this point in the history
  • Loading branch information
davismcphee committed Dec 3, 2022
1 parent 5ce0423 commit 25f23d6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions test/functional/apps/discover/group2/_huge_fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await security.testUser.restoreDefaults();
await esArchiver.unload('test/functional/fixtures/es_archiver/huge_fields');
await kibanaServer.uiSettings.unset('timepicker:timeDefaults');
await kibanaServer.savedObjects.cleanStandardList();
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await testSubjects.click('discoverNewButton');
await PageObjects.header.waitUntilLoadingHasFinished();

await retry.waitFor('number of fetches to be 0', waitForFetches(1));
await retry.waitFor('number of fetches to be 1', waitForFetches(1));
expect(await PageObjects.discover.doesSidebarShowFields()).to.be(false);
});
});
Expand Down
9 changes: 8 additions & 1 deletion test/functional/page_objects/time_picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,14 @@ export class TimePickerPageObject extends FtrService {
await this.testSubjects.click('superDatePickerToggleRefreshButton');
}

await this.inputValue('superDatePickerRefreshIntervalInput', intervalS.toString());
await this.retry.waitFor('auto refresh to be set correctly', async () => {
await this.inputValue('superDatePickerRefreshIntervalInput', intervalS.toString());
return (
(await this.testSubjects.getAttribute('superDatePickerRefreshIntervalInput', 'value')) ===
intervalS.toString()
);
});

await this.quickSelectTimeMenuToggle.close();
}

Expand Down

0 comments on commit 25f23d6

Please sign in to comment.