From 04ea4b735d3d4481336c45b121c1e0a680de0bbc Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 24 Sep 2024 08:07:44 -0700 Subject: [PATCH 1/7] Fix security errors in Observability case screenshot --- .../response_ops_docs/cases/settings.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/settings.ts b/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/settings.ts index 63332200a9dd5..682cd8bb757a5 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/settings.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/settings.ts @@ -12,12 +12,15 @@ import { navigateToCasesApp } from '../../../../../../shared/lib/cases'; export default function ({ getPageObject, getPageObjects, getService }: FtrProviderContext) { const svlCases = getService('svlCases'); const svlCommonScreenshots = getService('svlCommonScreenshots'); + const svlCommonPage = getPageObject('svlCommonPage'); const screenshotDirectories = ['response_ops_docs', 'observability_cases']; const testSubjects = getService('testSubjects'); const owner = OBSERVABILITY_OWNER; - // FLAKY:https://github.com/elastic/kibana/issues/189058 - describe.skip('Observability case settings', function () { + describe('Observability case settings', function () { + before(async () => { + await svlCommonPage.loginWithPrivilegedRole(); + }); after(async () => { await svlCases.api.deleteAllCaseItems(); }); From 88e041d27f50763931bc41a53f3352e09a8cd6e3 Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 24 Sep 2024 08:49:02 -0700 Subject: [PATCH 2/7] Add TheHive connector to Observability case screenshots --- .../functional/test_suites/observability/config.screenshots.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/test_serverless/functional/test_suites/observability/config.screenshots.ts b/x-pack/test_serverless/functional/test_suites/observability/config.screenshots.ts index 196de4506f38d..ae56c9fe4ece6 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/config.screenshots.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/config.screenshots.ts @@ -17,6 +17,7 @@ const enabledActionTypes = [ '.servicenow-itom', '.servicenow-sir', '.swimlane', + '.thehive', ]; export default createTestConfig({ From 73117d1cd1324d4f89b0a7b585bb235b1fd1c6bc Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 24 Sep 2024 13:41:38 -0700 Subject: [PATCH 3/7] Add retry steps in case automated screenshots --- .../response_ops_docs/cases/settings.ts | 26 ++++++++++++++++ .../response_ops_docs/cases/settings.ts | 31 +++++++++++++++++-- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/settings.ts b/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/settings.ts index 682cd8bb757a5..f7b914004a553 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/settings.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/settings.ts @@ -10,6 +10,8 @@ import { FtrProviderContext } from '../../../../../ftr_provider_context'; import { navigateToCasesApp } from '../../../../../../shared/lib/cases'; export default function ({ getPageObject, getPageObjects, getService }: FtrProviderContext) { + const pageObjects = getPageObjects(['header']); + const retry = getService('retry'); const svlCases = getService('svlCases'); const svlCommonScreenshots = getService('svlCommonScreenshots'); const svlCommonPage = getPageObject('svlCommonPage'); @@ -27,7 +29,13 @@ export default function ({ getPageObject, getPageObjects, getService }: FtrProvi it('case settings screenshots', async () => { await navigateToCasesApp(getPageObject, getService, owner); + await retry.waitFor('configure-case-button exist', async () => { + return await testSubjects.exists('configure-case-button'); + }); await testSubjects.click('configure-case-button'); + await retry.waitFor('add-custom-field exist', async () => { + return await testSubjects.exists('add-custom-field'); + }); await testSubjects.click('add-custom-field'); await svlCommonScreenshots.takeScreenshot( 'observability-cases-custom-fields', @@ -36,11 +44,17 @@ export default function ({ getPageObject, getPageObjects, getService }: FtrProvi 700 ); await testSubjects.setValue('custom-field-label-input', 'my-field'); + await retry.waitFor('common-flyout-save exist', async () => { + return await testSubjects.exists('common-flyout-save'); + }); await testSubjects.click('common-flyout-save'); await svlCommonScreenshots.takeScreenshot( 'observability-cases-settings', screenshotDirectories ); + await retry.waitFor('add-template exist', async () => { + return await testSubjects.exists('add-template'); + }); await testSubjects.click('add-template'); await svlCommonScreenshots.takeScreenshot( 'observability-cases-templates', @@ -48,13 +62,25 @@ export default function ({ getPageObject, getPageObjects, getService }: FtrProvi 1400, 1000 ); + await retry.waitFor('common-flyout-cancel exist', async () => { + return await testSubjects.exists('common-flyout-cancel'); + }); await testSubjects.click('common-flyout-cancel'); + await retry.waitFor('dropdown-connectors exist', async () => { + return await testSubjects.exists('dropdown-connectors'); + }); await testSubjects.click('dropdown-connectors'); + await retry.waitFor('dropdown-connector-add-connector exist', async () => { + return await testSubjects.exists('dropdown-connector-add-connector'); + }); await testSubjects.click('dropdown-connector-add-connector'); await svlCommonScreenshots.takeScreenshot( 'observability-cases-add-connector', screenshotDirectories ); + await retry.waitFor('euiFlyoutCloseButton exist', async () => { + return await testSubjects.exists('euiFlyoutCloseButton'); + }); await testSubjects.click('euiFlyoutCloseButton'); }); }); diff --git a/x-pack/test_serverless/functional/test_suites/security/screenshot_creation/response_ops_docs/cases/settings.ts b/x-pack/test_serverless/functional/test_suites/security/screenshot_creation/response_ops_docs/cases/settings.ts index 76dd5529cbafc..3661e10f78808 100644 --- a/x-pack/test_serverless/functional/test_suites/security/screenshot_creation/response_ops_docs/cases/settings.ts +++ b/x-pack/test_serverless/functional/test_suites/security/screenshot_creation/response_ops_docs/cases/settings.ts @@ -11,14 +11,14 @@ import { navigateToCasesApp } from '../../../../../../shared/lib/cases'; export default function ({ getPageObject, getPageObjects, getService }: FtrProviderContext) { const pageObjects = getPageObjects(['common', 'header', 'svlCommonPage', 'svlCommonNavigation']); + const retry = getService('retry'); const svlCases = getService('svlCases'); const svlCommonScreenshots = getService('svlCommonScreenshots'); const screenshotDirectories = ['response_ops_docs', 'security_cases']; const testSubjects = getService('testSubjects'); const owner = SECURITY_SOLUTION_OWNER; - // FLAKY: https://github.com/elastic/kibana/issues/188997 - describe.skip('security case settings', function () { + describe('security case settings', function () { after(async () => { await svlCases.api.deleteAllCaseItems(); }); @@ -29,8 +29,14 @@ export default function ({ getPageObject, getPageObjects, getService }: FtrProvi it('case settings screenshot', async () => { await navigateToCasesApp(getPageObject, getService, owner); + await retry.waitFor('configure-case-button exist', async () => { + return await testSubjects.exists('configure-case-button'); + }); await testSubjects.click('configure-case-button'); await pageObjects.header.waitUntilLoadingHasFinished(); + await retry.waitFor('add-custom-field exist', async () => { + return await testSubjects.exists('add-custom-field'); + }); await testSubjects.click('add-custom-field'); await svlCommonScreenshots.takeScreenshot( 'security-cases-custom-fields', @@ -38,9 +44,18 @@ export default function ({ getPageObject, getPageObjects, getService }: FtrProvi 1400, 700 ); + await retry.waitFor('custom-field-label-input exist', async () => { + return await testSubjects.exists('custom-field-label-input'); + }); await testSubjects.setValue('custom-field-label-input', 'my-field'); + await retry.waitFor('common-flyout-save exist', async () => { + return await testSubjects.exists('common-flyout-save'); + }); await testSubjects.click('common-flyout-save'); await svlCommonScreenshots.takeScreenshot('security-cases-settings', screenshotDirectories); + await retry.waitFor('add-template to exist', async () => { + return await testSubjects.exists('add-template'); + }); await testSubjects.click('add-template'); await svlCommonScreenshots.takeScreenshot( 'security-cases-templates', @@ -48,10 +63,22 @@ export default function ({ getPageObject, getPageObjects, getService }: FtrProvi 1400, 1000 ); + await retry.waitFor('common-flyout-cancel to exist', async () => { + return await testSubjects.exists('common-flyout-cancel'); + }); await testSubjects.click('common-flyout-cancel'); + await retry.waitFor('dropdown-connectors to exist', async () => { + return await testSubjects.exists('dropdown-connectors'); + }); await testSubjects.click('dropdown-connectors'); + await retry.waitFor('dropdown-connector-add-connector to exist', async () => { + return await testSubjects.exists('dropdown-connector-add-connector'); + }); await testSubjects.click('dropdown-connector-add-connector'); await svlCommonScreenshots.takeScreenshot('security-cases-connectors', screenshotDirectories); + await retry.waitFor('euiFlyoutCloseButton exist', async () => { + return await testSubjects.exists('euiFlyoutCloseButton'); + }); await testSubjects.click('euiFlyoutCloseButton'); }); }); From ca3b4498cd8b47e295b5c037ddf4d6a60cf980cb Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 24 Sep 2024 15:49:12 -0700 Subject: [PATCH 4/7] Remove unused pageObjects --- .../screenshot_creation/response_ops_docs/cases/settings.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/settings.ts b/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/settings.ts index f7b914004a553..6ce8cf81ed184 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/settings.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/settings.ts @@ -10,7 +10,6 @@ import { FtrProviderContext } from '../../../../../ftr_provider_context'; import { navigateToCasesApp } from '../../../../../../shared/lib/cases'; export default function ({ getPageObject, getPageObjects, getService }: FtrProviderContext) { - const pageObjects = getPageObjects(['header']); const retry = getService('retry'); const svlCases = getService('svlCases'); const svlCommonScreenshots = getService('svlCommonScreenshots'); From 860d6d09b8c7df353acf2462274297d492677fb5 Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 26 Sep 2024 13:24:22 -0700 Subject: [PATCH 5/7] Remove automated security-cases-connectors.png --- .../response_ops_docs/cases/settings.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/x-pack/test_serverless/functional/test_suites/security/screenshot_creation/response_ops_docs/cases/settings.ts b/x-pack/test_serverless/functional/test_suites/security/screenshot_creation/response_ops_docs/cases/settings.ts index 3661e10f78808..40718081871b4 100644 --- a/x-pack/test_serverless/functional/test_suites/security/screenshot_creation/response_ops_docs/cases/settings.ts +++ b/x-pack/test_serverless/functional/test_suites/security/screenshot_creation/response_ops_docs/cases/settings.ts @@ -67,18 +67,6 @@ export default function ({ getPageObject, getPageObjects, getService }: FtrProvi return await testSubjects.exists('common-flyout-cancel'); }); await testSubjects.click('common-flyout-cancel'); - await retry.waitFor('dropdown-connectors to exist', async () => { - return await testSubjects.exists('dropdown-connectors'); - }); - await testSubjects.click('dropdown-connectors'); - await retry.waitFor('dropdown-connector-add-connector to exist', async () => { - return await testSubjects.exists('dropdown-connector-add-connector'); - }); - await testSubjects.click('dropdown-connector-add-connector'); - await svlCommonScreenshots.takeScreenshot('security-cases-connectors', screenshotDirectories); - await retry.waitFor('euiFlyoutCloseButton exist', async () => { - return await testSubjects.exists('euiFlyoutCloseButton'); - }); await testSubjects.click('euiFlyoutCloseButton'); }); }); From 7b1f6869d123fd64e20b15782b167bf962620025 Mon Sep 17 00:00:00 2001 From: lcawl Date: Fri, 27 Sep 2024 10:25:27 -0700 Subject: [PATCH 6/7] Remove unnecessary euiFlyoutCloseButton --- .../screenshot_creation/response_ops_docs/cases/settings.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/test_serverless/functional/test_suites/security/screenshot_creation/response_ops_docs/cases/settings.ts b/x-pack/test_serverless/functional/test_suites/security/screenshot_creation/response_ops_docs/cases/settings.ts index 40718081871b4..59e1adab34078 100644 --- a/x-pack/test_serverless/functional/test_suites/security/screenshot_creation/response_ops_docs/cases/settings.ts +++ b/x-pack/test_serverless/functional/test_suites/security/screenshot_creation/response_ops_docs/cases/settings.ts @@ -67,7 +67,6 @@ export default function ({ getPageObject, getPageObjects, getService }: FtrProvi return await testSubjects.exists('common-flyout-cancel'); }); await testSubjects.click('common-flyout-cancel'); - await testSubjects.click('euiFlyoutCloseButton'); }); }); } From c5f6f9d669bc595a138da4008c9c73e47bae6fe4 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 13 Nov 2024 16:03:43 -0800 Subject: [PATCH 7/7] Update path to new connector --- .../screenshot_creation/response_ops_docs/cases/settings.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/settings.ts b/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/settings.ts index 6ce8cf81ed184..d692442c55717 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/settings.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/settings.ts @@ -68,11 +68,7 @@ export default function ({ getPageObject, getPageObjects, getService }: FtrProvi await retry.waitFor('dropdown-connectors exist', async () => { return await testSubjects.exists('dropdown-connectors'); }); - await testSubjects.click('dropdown-connectors'); - await retry.waitFor('dropdown-connector-add-connector exist', async () => { - return await testSubjects.exists('dropdown-connector-add-connector'); - }); - await testSubjects.click('dropdown-connector-add-connector'); + await testSubjects.click('add-new-connector'); await svlCommonScreenshots.takeScreenshot( 'observability-cases-add-connector', screenshotDirectories