From d5ed6433098a6529f3ca8a9360b5692f43c2b340 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 23 Oct 2023 08:32:46 -0400 Subject: [PATCH] [8.11] [DOCS] Automate Observability and Security case setting screenshots (#168774) (#169509) # Backport This will backport the following commits from `main` to `8.11`: - [[DOCS] Automate Observability and Security case setting screenshots (#168774)](https://github.com/elastic/kibana/pull/168774) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Lisa Cawley --- .../observability_cases/custom_fields.ts | 40 +++++++++++++++++++ .../observability_cases/index.ts | 1 + .../observability_cases/list_view.ts | 6 +++ .../security_cases/custom_fields.ts | 39 ++++++++++++++++++ .../response_ops_docs/security_cases/index.ts | 1 + 5 files changed, 87 insertions(+) create mode 100644 x-pack/test/screenshot_creation/apps/response_ops_docs/observability_cases/custom_fields.ts create mode 100644 x-pack/test/screenshot_creation/apps/response_ops_docs/security_cases/custom_fields.ts diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/observability_cases/custom_fields.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/observability_cases/custom_fields.ts new file mode 100644 index 0000000000000..1cd8ae736afbc --- /dev/null +++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/observability_cases/custom_fields.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default function ({ getPageObjects, getService }: FtrProviderContext) { + const cases = getService('cases'); + const commonScreenshots = getService('commonScreenshots'); + const pageObjects = getPageObjects(['common', 'header']); + const screenshotDirectories = ['response_ops_docs', 'observability_cases']; + const testSubjects = getService('testSubjects'); + + describe('Observability case settings and custom fields', function () { + it('case settings screenshots', async () => { + await cases.navigation.navigateToApp('observability/cases', 'cases-all-title'); + await pageObjects.header.waitUntilLoadingHasFinished(); + await testSubjects.click('configure-case-button'); + await commonScreenshots.takeScreenshot('cases-settings', screenshotDirectories); + await testSubjects.click('add-custom-field'); + await commonScreenshots.takeScreenshot( + 'cases-add-custom-field', + screenshotDirectories, + 1400, + 600 + ); + await testSubjects.setValue('custom-field-label-input', 'my-field'); + await testSubjects.click('custom-field-flyout-save'); + await commonScreenshots.takeScreenshot( + 'cases-custom-field-settings', + screenshotDirectories, + 1400, + 1024 + ); + }); + }); +} diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/observability_cases/index.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/observability_cases/index.ts index 0e0e81dca10c9..2b513391209a5 100644 --- a/x-pack/test/screenshot_creation/apps/response_ops_docs/observability_cases/index.ts +++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/observability_cases/index.ts @@ -10,5 +10,6 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ loadTestFile }: FtrProviderContext) { describe('observability cases', function () { loadTestFile(require.resolve('./list_view')); + loadTestFile(require.resolve('./custom_fields')); }); } diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/observability_cases/list_view.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/observability_cases/list_view.ts index 309c17f6ee498..e156ef4fbfa30 100644 --- a/x-pack/test/screenshot_creation/apps/response_ops_docs/observability_cases/list_view.ts +++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/observability_cases/list_view.ts @@ -96,5 +96,11 @@ export default function ({ getPageObject, getService }: FtrProviderContext) { 1024 ); }); + + it('case settings screenshot', async () => { + await cases.navigation.navigateToApp('observability/cases', 'cases-all-title'); + await testSubjects.click('configure-case-button'); + await commonScreenshots.takeScreenshot('add-case-connector', screenshotDirectories); + }); }); } diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/security_cases/custom_fields.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/security_cases/custom_fields.ts new file mode 100644 index 0000000000000..412f102353cc0 --- /dev/null +++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/security_cases/custom_fields.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const commonScreenshots = getService('commonScreenshots'); + const pageObjects = getPageObjects(['common', 'header']); + const screenshotDirectories = ['response_ops_docs', 'security_cases']; + const testSubjects = getService('testSubjects'); + + describe('Security case settings and custom fields', function () { + it('case settings screenshots', async () => { + await pageObjects.common.navigateToApp('security', { path: 'cases' }); + await pageObjects.header.waitUntilLoadingHasFinished(); + await testSubjects.click('configure-case-button'); + await commonScreenshots.takeScreenshot('cases-settings', screenshotDirectories); + await testSubjects.click('add-custom-field'); + await commonScreenshots.takeScreenshot( + 'cases-add-custom-field', + screenshotDirectories, + 1400, + 600 + ); + await testSubjects.setValue('custom-field-label-input', 'my-field'); + await testSubjects.click('custom-field-flyout-save'); + await commonScreenshots.takeScreenshot( + 'cases-custom-field-settings', + screenshotDirectories, + 1400, + 1024 + ); + }); + }); +} diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/security_cases/index.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/security_cases/index.ts index dc038fc7cf46f..599b8f49c6b09 100644 --- a/x-pack/test/screenshot_creation/apps/response_ops_docs/security_cases/index.ts +++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/security_cases/index.ts @@ -10,5 +10,6 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ loadTestFile }: FtrProviderContext) { describe('security cases', function () { loadTestFile(require.resolve('./list_view')); + loadTestFile(require.resolve('./custom_fields')); }); }