[DOCS] Add screenshot automation for security cases (#161412)

This commit is contained in:
Lisa Cawley 2023-07-07 09:31:15 -07:00 committed by GitHub
parent 96beacf080
commit 9791c47fa2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 68 additions and 0 deletions

View file

@ -44,5 +44,6 @@ export default function ({ getPageObject, getService, loadTestFile }: FtrProvide
loadTestFile(require.resolve('./stack_connectors'));
loadTestFile(require.resolve('./maintenance_windows'));
loadTestFile(require.resolve('./observability_cases'));
loadTestFile(require.resolve('./security_cases'));
});
}

View file

@ -0,0 +1,14 @@
/*
* 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 ({ loadTestFile }: FtrProviderContext) {
describe('security cases', function () {
loadTestFile(require.resolve('./list_view'));
});
}

View file

@ -0,0 +1,53 @@
/*
* 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 { CaseSeverity } from '@kbn/cases-plugin/common/api';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getPageObject, getService, getPageObjects }: FtrProviderContext) {
const cases = getService('cases');
const commonScreenshots = getService('commonScreenshots');
const screenshotDirectories = ['response_ops_docs', 'security_cases'];
const pageObjects = getPageObjects(['common', 'header']);
describe('list view', function () {
before(async () => {
await cases.api.createCase({
title: 'Unusual processes identified',
tags: ['linux', 'os processes'],
description: 'Test.',
owner: 'securitySolution',
severity: CaseSeverity.HIGH,
});
await cases.api.createCase({
title: 'Suspicious emails reported',
tags: ['email', 'phishing'],
description: 'Test.',
owner: 'securitySolution',
});
await cases.api.createCase({
title: 'Malware investigation',
tags: ['malware'],
description: 'Test.',
owner: 'securitySolution',
severity: CaseSeverity.MEDIUM,
});
});
after(async () => {
await cases.api.deleteAllCases();
});
it('cases list screenshot', async () => {
await pageObjects.common.navigateToApp('security', { path: 'cases' });
await pageObjects.header.waitUntilLoadingHasFinished();
await commonScreenshots.takeScreenshot('cases-home-page', screenshotDirectories, 1700, 1024);
});
});
}