diff --git a/x-pack/test/functional/apps/infra/metrics_explorer.ts b/x-pack/test/functional/apps/infra/metrics_explorer.ts index 0c42e6e2cad9d..47f5c9785d393 100644 --- a/x-pack/test/functional/apps/infra/metrics_explorer.ts +++ b/x-pack/test/functional/apps/infra/metrics_explorer.ts @@ -132,7 +132,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.infraSavedViews.ensureViewIsLoaded('view1'); }); - it('should laod a clicked view from the manage views section', async () => { + it('should load a clicked view from the manage views section', async () => { const views = await pageObjects.infraSavedViews.getManageViewsEntries(); await views[0].click(); await pageObjects.infraSavedViews.ensureViewIsLoaded('Default view'); diff --git a/x-pack/test/functional/page_objects/infra_saved_views.ts b/x-pack/test/functional/page_objects/infra_saved_views.ts index a9cdc8ffdab40..56c6e0d1354fb 100644 --- a/x-pack/test/functional/page_objects/infra_saved_views.ts +++ b/x-pack/test/functional/page_objects/infra_saved_views.ts @@ -15,8 +15,15 @@ export function InfraSavedViewsProvider({ getService }: FtrProviderContext) { const browser = getService('browser'); return { - clickSavedViewsButton() { - return testSubjects.click('savedViews-openPopover'); + async clickSavedViewsButton() { + const button = await testSubjects.find('savedViews-openPopover'); + + await retry.waitFor('Wait for button to be enabled', async () => { + const isDisabled = Boolean(await button.getAttribute('disabled')); + return !isDisabled; + }); + + return button.click(); }, pressEsc() { return browser.pressKeys([Key.ESCAPE]);