From b6a974d25d9874b87cb1bb69010be3dbecace9bf Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 12 Oct 2023 18:06:52 -0700 Subject: [PATCH 1/4] [DOCS] Automate Observability case settings screenshot --- .../apps/response_ops_docs/observability_cases/list_view.ts | 6 ++++++ 1 file changed, 6 insertions(+) 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..330d37bca1625 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-connectors', screenshotDirectories); + }); }); } From d69420468031aa901254c4e5a0c6eddfa35d87d8 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Thu, 12 Oct 2023 18:22:12 -0700 Subject: [PATCH 2/4] Fix image file name --- .../apps/response_ops_docs/observability_cases/list_view.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 330d37bca1625..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 @@ -100,7 +100,7 @@ export default function ({ getPageObject, getService }: FtrProviderContext) { 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-connectors', screenshotDirectories); + await commonScreenshots.takeScreenshot('add-case-connector', screenshotDirectories); }); }); } From d35291d85305d9887ce3e230ff320d194f2bf37d Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 12 Oct 2023 18:50:11 -0700 Subject: [PATCH 3/4] [DOCS] Automate Security case settings screenshot --- .../apps/response_ops_docs/security_cases/list_view.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/security_cases/list_view.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/security_cases/list_view.ts index 5d599a43082f6..6a0d829d14535 100644 --- a/x-pack/test/screenshot_creation/apps/response_ops_docs/security_cases/list_view.ts +++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/security_cases/list_view.ts @@ -82,5 +82,11 @@ export default function ({ getPageObject, getService, getPageObjects }: FtrProvi await filesTab.click(); await commonScreenshots.takeScreenshot('cases-files', screenshotDirectories, 1400, 1024); }); + + it('case settings screenshot', async () => { + await pageObjects.common.navigateToApp('security', { path: 'cases' }); + await testSubjects.click('configure-case-button'); + await commonScreenshots.takeScreenshot('cases-ui-connector', screenshotDirectories); + }); }); } From 35347e9a55fafba6370c2a019ba5503d26cd5748 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 18 Oct 2023 10:20:08 -0700 Subject: [PATCH 4/4] Automate more screenshots --- .../observability_cases/custom_fields.ts | 40 +++++++++++++++++++ .../observability_cases/index.ts | 1 + .../security_cases/custom_fields.ts | 39 ++++++++++++++++++ .../response_ops_docs/security_cases/index.ts | 1 + .../security_cases/list_view.ts | 6 --- 5 files changed, 81 insertions(+), 6 deletions(-) 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/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')); }); } diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/security_cases/list_view.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/security_cases/list_view.ts index 6a0d829d14535..5d599a43082f6 100644 --- a/x-pack/test/screenshot_creation/apps/response_ops_docs/security_cases/list_view.ts +++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/security_cases/list_view.ts @@ -82,11 +82,5 @@ export default function ({ getPageObject, getService, getPageObjects }: FtrProvi await filesTab.click(); await commonScreenshots.takeScreenshot('cases-files', screenshotDirectories, 1400, 1024); }); - - it('case settings screenshot', async () => { - await pageObjects.common.navigateToApp('security', { path: 'cases' }); - await testSubjects.click('configure-case-button'); - await commonScreenshots.takeScreenshot('cases-ui-connector', screenshotDirectories); - }); }); }