diff --git a/x-pack/test/security_solution_endpoint/apps/integrations/endpoint_exceptions.ts b/x-pack/test/security_solution_endpoint/apps/integrations/endpoint_exceptions.ts index 42d28132998bf..eac635ac958eb 100644 --- a/x-pack/test/security_solution_endpoint/apps/integrations/endpoint_exceptions.ts +++ b/x-pack/test/security_solution_endpoint/apps/integrations/endpoint_exceptions.ts @@ -22,6 +22,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const endpointTestResources = getService('endpointTestResources'); const endpointArtifactTestResources = getService('endpointArtifactTestResources'); const retry = getService('retry'); + const retryOnStale = getService('retryOnStale'); const esClient = getService('es'); const supertest = getService('supertest'); const find = getService('find'); @@ -30,30 +31,17 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const toasts = getService('toasts'); const MINUTES = 60 * 1000 * 10; - // FLAKY: https://github.com/elastic/kibana/issues/173441 - // Failing: See https://github.com/elastic/kibana/issues/173441 - describe.skip('Endpoint Exceptions', function () { + describe('Endpoint Exceptions', function () { targetTags(this, ['@ess', '@serverless']); - this.timeout(10 * MINUTES); - const clearPrefilledEntries = async () => { - const entriesContainer = await testSubjects.find('exceptionEntriesContainer'); - - let deleteButtons: WebElementWrapper[]; - do { - deleteButtons = await testSubjects.findAllDescendant( - 'builderItemEntryDeleteButton', - entriesContainer - ); - - await deleteButtons[0].click(); - } while (deleteButtons.length > 1); - }; + let clearPrefilledEntries: () => Promise; const openNewEndpointExceptionFlyout = async () => { - await testSubjects.scrollIntoView('timeline-context-menu-button'); - await testSubjects.click('timeline-context-menu-button'); + retryOnStale(async () => { + await testSubjects.scrollIntoView('timeline-context-menu-button'); + await testSubjects.click('timeline-context-menu-button'); + }); await testSubjects.click('add-endpoint-exception-menu-item'); await testSubjects.existOrFail('addExceptionFlyout'); @@ -166,10 +154,25 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }; await deleteEndpointExceptions(); + + clearPrefilledEntries = retryOnStale.wrap(async () => { + const entriesContainer = await testSubjects.find('exceptionEntriesContainer'); + + let deleteButtons: WebElementWrapper[]; + do { + deleteButtons = await testSubjects.findAllDescendant( + 'builderItemEntryDeleteButton', + entriesContainer + ); + + await deleteButtons[0].click(); + } while (deleteButtons.length > 1); + }); }); it('should add `event.module=endpoint` to entry if only wildcard operator is present', async () => { await pageObjects.common.navigateToUrlWithBrowserHistory('security', `/alerts`); + await pageObjects.header.waitUntilLoadingHasFinished(); await pageObjects.timePicker.setCommonlyUsedTime('Last_24 hours'); await openNewEndpointExceptionFlyout(); @@ -215,6 +218,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { it('should NOT add `event.module=endpoint` to entry if there is another operator', async () => { await pageObjects.common.navigateToUrlWithBrowserHistory('security', `/alerts`); + await pageObjects.header.waitUntilLoadingHasFinished(); await pageObjects.timePicker.setCommonlyUsedTime('Last_24 hours'); await openNewEndpointExceptionFlyout(); diff --git a/x-pack/test/security_solution_endpoint/apps/integrations/index.ts b/x-pack/test/security_solution_endpoint/apps/integrations/index.ts index 7bf73a60499d2..037ee3d60ec3e 100644 --- a/x-pack/test/security_solution_endpoint/apps/integrations/index.ts +++ b/x-pack/test/security_solution_endpoint/apps/integrations/index.ts @@ -12,7 +12,7 @@ import { FtrProviderContext } from '../../configs/ftr_provider_context'; export default function (providerContext: FtrProviderContext) { const { loadTestFile, getService, getPageObjects } = providerContext; - describe('endpoint', function () { + describe('integrations', function () { const ingestManager = getService('ingestManager'); const log = getService('log'); const endpointTestResources = getService('endpointTestResources');