[Uptime] Fix overview flaky tests (#99781) (#100155)

* add retry logic and add describe.only to prepare for flaky test runner

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Dominique Clarke <doclarke71@gmail.com>
This commit is contained in:
Kibana Machine 2021-05-14 16:37:38 -04:00 committed by GitHub
parent 0da82b0d6f
commit 22a34602b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 26 deletions

View file

@ -26,6 +26,7 @@ export function TimePickerProvider({ getService, getPageObjects }: FtrProviderCo
const log = getService('log');
const find = getService('find');
const browser = getService('browser');
const retry = getService('retry');
const testSubjects = getService('testSubjects');
const { header } = getPageObjects(['header']);
const kibanaServer = getService('kibanaServer');
@ -68,7 +69,9 @@ export function TimePickerProvider({ getService, getPageObjects }: FtrProviderCo
}
private async getTimePickerPanel() {
return await find.byCssSelector('div.euiPopover__panel-isOpen');
return await retry.try(async () => {
return await find.byCssSelector('div.euiPopover__panel-isOpen');
});
}
private async waitPanelIsGone(panelElement: WebElementWrapper) {

View file

@ -24,6 +24,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
beforeEach(async () => {
await uptime.goToRoot();
await uptime.setDateRange(DEFAULT_DATE_START, DEFAULT_DATE_END);
await uptime.resetFilters();
});
@ -57,40 +58,46 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
it('pagination is cleared when filter criteria changes', async () => {
await uptime.changePage('next');
await uptime.pageHasExpectedIds([
'0010-down',
'0011-up',
'0012-up',
'0013-up',
'0014-up',
'0015-intermittent',
'0016-up',
'0017-up',
'0018-up',
'0019-up',
]);
await retry.try(async () => {
await uptime.pageHasExpectedIds([
'0010-down',
'0011-up',
'0012-up',
'0013-up',
'0014-up',
'0015-intermittent',
'0016-up',
'0017-up',
'0018-up',
'0019-up',
]);
});
// there should now be pagination data in the URL
await uptime.pageUrlContains('pagination');
await uptime.setStatusFilter('up');
await uptime.pageHasExpectedIds([
'0000-intermittent',
'0001-up',
'0002-up',
'0003-up',
'0004-up',
'0005-up',
'0006-up',
'0007-up',
'0008-up',
'0009-up',
]);
await retry.try(async () => {
await uptime.pageHasExpectedIds([
'0000-intermittent',
'0001-up',
'0002-up',
'0003-up',
'0004-up',
'0005-up',
'0006-up',
'0007-up',
'0008-up',
'0009-up',
]);
});
// ensure that pagination is removed from the URL
await uptime.pageUrlContains('pagination', false);
});
it('clears pagination parameters when size changes', async () => {
await uptime.changePage('next');
await uptime.pageUrlContains('pagination');
await retry.try(async () => {
await uptime.pageUrlContains('pagination');
});
await uptime.setMonitorListPageSize(50);
// the pagination parameter should be cleared after a size change
await uptime.pageUrlContains('pagination', false);