diff --git a/test/support/page_objects/common.js b/test/support/page_objects/common.js index cfceb99485b87..87c565cfe081c 100644 --- a/test/support/page_objects/common.js +++ b/test/support/page_objects/common.js @@ -68,6 +68,13 @@ export default class Common { } } + waitUntilUrlIncludes(path) { + return this.tryForTime(defaultFindTimeout, async () => { + const url = await this.remote.getCurrentUrl(); + if (!url.includes(path)) throw new Error('Url not found'); + }); + } + getHostPort() { return getUrl.baseUrl(config.servers.kibana); } diff --git a/test/support/page_objects/discover_page.js b/test/support/page_objects/discover_page.js index d4ddce789c54e..ba12f8ea54a84 100644 --- a/test/support/page_objects/discover_page.js +++ b/test/support/page_objects/discover_page.js @@ -296,6 +296,7 @@ export default class DiscoverPage { await PageObjects.common.clickTestSubject('showFilterActions'); await PageObjects.common.clickTestSubject('removeAllFilters'); await PageObjects.header.waitUntilLoadingHasFinished(); + await PageObjects.common.waitUntilUrlIncludes('filters:!()'); }