diff --git a/x-pack/test/functional/apps/infra/logs/log_entry_categories_tab.ts b/x-pack/test/functional/apps/infra/logs/log_entry_categories_tab.ts index 6943c393cd8f9..dc5b8dacafd5c 100644 --- a/x-pack/test/functional/apps/infra/logs/log_entry_categories_tab.ts +++ b/x-pack/test/functional/apps/infra/logs/log_entry_categories_tab.ts @@ -11,11 +11,18 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default ({ getPageObjects, getService }: FtrProviderContext) => { const PageObjects = getPageObjects(['security']); + const config = getService('config'); const esArchiver = getService('esArchiver'); const logsUi = getService('logsUi'); const retry = getService('retry'); const security = getService('security'); + const retryNavigationOptions = { + retryCount: 2, + retryDelay: 0, + timeout: config.get('timeouts.try') * 2, + }; + describe('Log Entry Categories Tab', function () { this.tags('includeFirefox'); @@ -61,11 +68,17 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { before(() => logsUi.cleanIndices()); it('Shows no data page when indices do not exist', async () => { - await logsUi.logEntryCategoriesPage.navigateTo(); - - await retry.try(async () => { - expect(await logsUi.logEntryCategoriesPage.getNoDataScreen()).to.be.ok(); - }); + await retry.tryWithRetries( + "retry if indices haven't been refreshed yet", + async () => { + await logsUi.logEntryCategoriesPage.navigateTo(); + + await retry.try(async () => { + expect(await logsUi.logEntryCategoriesPage.getNoDataScreen()).to.be.ok(); + }); + }, + retryNavigationOptions + ); }); describe('when indices exists', () => { @@ -78,11 +91,17 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); it('shows setup page when indices exist', async () => { - await logsUi.logEntryCategoriesPage.navigateTo(); - - await retry.try(async () => { - expect(await logsUi.logEntryCategoriesPage.getSetupScreen()).to.be.ok(); - }); + await retry.tryWithRetries( + "retry if indices haven't been refreshed yet", + async () => { + await logsUi.logEntryCategoriesPage.navigateTo(); + + await retry.try(async () => { + expect(await logsUi.logEntryCategoriesPage.getSetupScreen()).to.be.ok(); + }); + }, + retryNavigationOptions + ); }); it('shows required ml read privileges prompt when the user has not any ml privileges', async () => {