mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[DOCS] Add more automated screenshots for security cases (#161485)
This commit is contained in:
parent
31b28a0660
commit
ff6099eb3f
1 changed files with 36 additions and 3 deletions
|
@ -7,12 +7,18 @@
|
|||
|
||||
import { CaseSeverity } from '@kbn/cases-plugin/common/api';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
import { createAndUploadFile } from '../../../../cases_api_integration/common/lib/api';
|
||||
import { SECURITY_SOLUTION_FILE_KIND } from '../../../../cases_api_integration/common/lib/constants';
|
||||
|
||||
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']);
|
||||
const screenshotDirectories = ['response_ops_docs', 'security_cases'];
|
||||
const supertest = getService('supertest');
|
||||
const testSubjects = getService('testSubjects');
|
||||
let caseIdSuspiciousEmail: string;
|
||||
let caseOwnerSuspiciousEmail: string;
|
||||
|
||||
describe('list view', function () {
|
||||
before(async () => {
|
||||
|
@ -24,12 +30,14 @@ export default function ({ getPageObject, getService, getPageObjects }: FtrProvi
|
|||
severity: CaseSeverity.HIGH,
|
||||
});
|
||||
|
||||
await cases.api.createCase({
|
||||
const caseSuspiciousEmail = await cases.api.createCase({
|
||||
title: 'Suspicious emails reported',
|
||||
tags: ['email', 'phishing'],
|
||||
description: 'Test.',
|
||||
description: 'Several employees have received suspicious emails from an unknown address.',
|
||||
owner: 'securitySolution',
|
||||
});
|
||||
caseIdSuspiciousEmail = caseSuspiciousEmail.id;
|
||||
caseOwnerSuspiciousEmail = caseSuspiciousEmail.owner;
|
||||
|
||||
await cases.api.createCase({
|
||||
title: 'Malware investigation',
|
||||
|
@ -38,6 +46,20 @@ export default function ({ getPageObject, getService, getPageObjects }: FtrProvi
|
|||
owner: 'securitySolution',
|
||||
severity: CaseSeverity.MEDIUM,
|
||||
});
|
||||
|
||||
await createAndUploadFile({
|
||||
supertest,
|
||||
createFileParams: {
|
||||
name: 'testfile',
|
||||
kind: SECURITY_SOLUTION_FILE_KIND,
|
||||
mimeType: 'image/png',
|
||||
meta: {
|
||||
caseIds: [caseIdSuspiciousEmail],
|
||||
owner: [caseOwnerSuspiciousEmail],
|
||||
},
|
||||
},
|
||||
data: 'abc',
|
||||
});
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
|
@ -49,5 +71,16 @@ export default function ({ getPageObject, getService, getPageObjects }: FtrProvi
|
|||
await pageObjects.header.waitUntilLoadingHasFinished();
|
||||
await commonScreenshots.takeScreenshot('cases-home-page', screenshotDirectories, 1700, 1024);
|
||||
});
|
||||
|
||||
it('case details screenshot', async () => {
|
||||
await pageObjects.common.navigateToApp('security', {
|
||||
path: `cases/${caseIdSuspiciousEmail}`,
|
||||
});
|
||||
await commonScreenshots.takeScreenshot('cases-ui-open', screenshotDirectories, 1400, 1024);
|
||||
|
||||
const filesTab = await testSubjects.find('case-view-tab-title-files');
|
||||
await filesTab.click();
|
||||
await commonScreenshots.takeScreenshot('cases-files', screenshotDirectories, 1400, 1024);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue