Skip to content

Commit

Permalink
[DOCS] Automate Observability and Security case setting screenshots (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored Oct 23, 2023
1 parent 71bbbac commit 6adb8bd
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
);
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
}
Original file line number Diff line number Diff line change
@@ -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
);
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
});
}

0 comments on commit 6adb8bd

Please sign in to comment.