[Uptime] Fix flaky functional test for #54541 (#56449) (#56656)

* Add timeout block to race-prone functional test code.

* Add timeout for pagination click functions.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Justin Kambic 2020-02-03 14:01:52 -07:00 committed by GitHub
parent e1b78746ee
commit 9f0f92e164
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View file

@ -53,8 +53,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
it('pagination is cleared when filter criteria changes', async () => {
await pageObjects.uptime.goToUptimePageAndSetDateRange(DEFAULT_DATE_START, DEFAULT_DATE_END);
await pageObjects.uptime.changePage('next');
// there should now be pagination data in the URL
await pageObjects.uptime.pageUrlContains('pagination');
await pageObjects.uptime.pageHasExpectedIds([
'0010-down',
'0011-up',
@ -67,9 +65,11 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
'0018-up',
'0019-up',
]);
await retry.tryForTime(12000, async () => {
// there should now be pagination data in the URL
await pageObjects.uptime.pageUrlContains('pagination');
});
await pageObjects.uptime.setStatusFilter('up');
// ensure that pagination is removed from the URL
await pageObjects.uptime.pageUrlContains('pagination', false);
await pageObjects.uptime.pageHasExpectedIds([
'0000-intermittent',
'0001-up',
@ -82,6 +82,10 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
'0008-up',
'0009-up',
]);
await retry.tryForTime(12000, async () => {
// ensure that pagination is removed from the URL
await pageObjects.uptime.pageUrlContains('pagination', false);
});
});
describe('snapshot counts', () => {

View file

@ -38,10 +38,10 @@ export function UptimeProvider({ getService }: FtrProviderContext) {
await browser.pressKeys(browser.keys.ENTER);
},
async goToNextPage() {
await testSubjects.click('xpack.uptime.monitorList.nextButton');
await testSubjects.click('xpack.uptime.monitorList.nextButton', 5000);
},
async goToPreviousPage() {
await testSubjects.click('xpack.uptime.monitorList.prevButton');
await testSubjects.click('xpack.uptime.monitorList.prevButton', 5000);
},
async setStatusFilterUp() {
await testSubjects.click('xpack.uptime.filterBar.filterStatusUp');