From 205c710f85177183605de6988bd736ca39e43462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20=C3=81brah=C3=A1m?= Date: Wed, 15 May 2024 10:28:41 +0200 Subject: [PATCH 1/5] extract MINUTES constant --- .../apps/integrations/endpoint_exceptions.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 e1d77eb293896..3a181f41e0b61 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 @@ -29,11 +29,13 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const comboBox = getService('comboBox'); const toasts = getService('toasts'); + const MINUTES = 60_000; + // Failing: See https://github.com/elastic/kibana/issues/176009 describe.skip('Endpoint Exceptions', function () { targetTags(this, ['@ess', '@serverless']); - this.timeout(10 * 60_000); + this.timeout(10 * MINUTES); const clearPrefilledEntries = async () => { const entriesContainer = await testSubjects.find('exceptionEntriesContainer'); @@ -102,7 +104,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }; const checkArtifact = (expectedArtifact: object) => { - return retry.tryForTime(120_000, async () => { + return retry.tryForTime(2 * MINUTES, async () => { const artifacts = await endpointArtifactTestResources.getArtifacts(); const manifestArtifact = artifacts.find((artifact) => @@ -133,7 +135,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const waitForAlertsToAppear = async () => { await pageObjects.common.navigateToUrlWithBrowserHistory('security', `/alerts`); await pageObjects.header.waitUntilLoadingHasFinished(); - await retry.waitForWithTimeout('alerts to appear', 10 * 60_000, async () => { + await retry.waitForWithTimeout('alerts to appear', 10 * MINUTES, async () => { await queryBar.clickQuerySubmitButton(); return testSubjects.exists('timeline-context-menu-button'); }); From ca8426b1f7f58dc3be0222b61dd193036611ccf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20=C3=81brah=C3=A1m?= Date: Wed, 15 May 2024 10:29:30 +0200 Subject: [PATCH 2/5] enable endpoint exceptions integration test --- .../apps/integrations/endpoint_exceptions.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 3a181f41e0b61..fe0cca08accbe 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 @@ -31,8 +31,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const MINUTES = 60_000; - // Failing: See https://github.com/elastic/kibana/issues/176009 - describe.skip('Endpoint Exceptions', function () { + describe('Endpoint Exceptions', function () { targetTags(this, ['@ess', '@serverless']); this.timeout(10 * MINUTES); From 8356bcfbfc3f2b2e5a23a498df27964380ddb063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20=C3=81brah=C3=A1m?= Date: Wed, 15 May 2024 10:29:55 +0200 Subject: [PATCH 3/5] TEMP: run only endpoint exceptions test --- .../apps/integrations/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 1f830a06d3103..cd8f37b1a1401 100644 --- a/x-pack/test/security_solution_endpoint/apps/integrations/index.ts +++ b/x-pack/test/security_solution_endpoint/apps/integrations/index.ts @@ -42,11 +42,11 @@ export default function (providerContext: FtrProviderContext) { await pageObjects.svlCommonPage.login(); } }); - loadTestFile(require.resolve('./policy_list')); - loadTestFile(require.resolve('./policy_details')); - loadTestFile(require.resolve('./trusted_apps_list')); - loadTestFile(require.resolve('./fleet_integrations')); - loadTestFile(require.resolve('./artifact_entries_list')); + // loadTestFile(require.resolve('./policy_list')); + // loadTestFile(require.resolve('./policy_details')); + // loadTestFile(require.resolve('./trusted_apps_list')); + // loadTestFile(require.resolve('./fleet_integrations')); + // loadTestFile(require.resolve('./artifact_entries_list')); loadTestFile(require.resolve('./endpoint_exceptions')); }); } From 43b5845aa9e1f9cc403f634288a00d7b9006103a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20=C3=81brah=C3=A1m?= Date: Wed, 15 May 2024 14:22:36 +0200 Subject: [PATCH 4/5] display alerts from the last 24 hours to avoid test fail during midnight --- .../apps/integrations/endpoint_exceptions.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 fe0cca08accbe..26a1d95f4efbb 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 @@ -16,7 +16,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; import { targetTags } from '../../target_tags'; export default ({ getPageObjects, getService }: FtrProviderContext) => { - const pageObjects = getPageObjects(['common', 'header']); + const pageObjects = getPageObjects(['common', 'header', 'timePicker']); const queryBar = getService('queryBar'); const testSubjects = getService('testSubjects'); const endpointTestResources = getService('endpointTestResources'); @@ -51,6 +51,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }; const openNewEndpointExceptionFlyout = 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'); @@ -134,6 +135,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const waitForAlertsToAppear = async () => { await pageObjects.common.navigateToUrlWithBrowserHistory('security', `/alerts`); await pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.timePicker.setCommonlyUsedTime('Last_24 hours'); await retry.waitForWithTimeout('alerts to appear', 10 * MINUTES, async () => { await queryBar.clickQuerySubmitButton(); return testSubjects.exists('timeline-context-menu-button'); @@ -165,6 +167,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { it('should add `event.module=endpoint` to entry if only wildcard operator is present', async () => { await pageObjects.common.navigateToUrlWithBrowserHistory('security', `/alerts`); + await pageObjects.timePicker.setCommonlyUsedTime('Last_24 hours'); await openNewEndpointExceptionFlyout(); await clearPrefilledEntries(); @@ -209,6 +212,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.timePicker.setCommonlyUsedTime('Last_24 hours'); await openNewEndpointExceptionFlyout(); await clearPrefilledEntries(); From 76ed911ac28446b700ecd0304ada40b71acbc511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20=C3=81brah=C3=A1m?= Date: Wed, 15 May 2024 17:39:44 +0200 Subject: [PATCH 5/5] Revert "TEMP: run only endpoint exceptions test" This reverts commit 8356bcfbfc3f2b2e5a23a498df27964380ddb063. --- .../apps/integrations/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 cd8f37b1a1401..1f830a06d3103 100644 --- a/x-pack/test/security_solution_endpoint/apps/integrations/index.ts +++ b/x-pack/test/security_solution_endpoint/apps/integrations/index.ts @@ -42,11 +42,11 @@ export default function (providerContext: FtrProviderContext) { await pageObjects.svlCommonPage.login(); } }); - // loadTestFile(require.resolve('./policy_list')); - // loadTestFile(require.resolve('./policy_details')); - // loadTestFile(require.resolve('./trusted_apps_list')); - // loadTestFile(require.resolve('./fleet_integrations')); - // loadTestFile(require.resolve('./artifact_entries_list')); + loadTestFile(require.resolve('./policy_list')); + loadTestFile(require.resolve('./policy_details')); + loadTestFile(require.resolve('./trusted_apps_list')); + loadTestFile(require.resolve('./fleet_integrations')); + loadTestFile(require.resolve('./artifact_entries_list')); loadTestFile(require.resolve('./endpoint_exceptions')); }); }