Skip to content

Commit

Permalink
[DOCS] Refresh and automate screenshots for connector logs (#153510)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored Mar 23, 2023
1 parent 9ff847d commit 552e472
Show file tree
Hide file tree
Showing 12 changed files with 116 additions and 14 deletions.
4 changes: 3 additions & 1 deletion docs/management/action-types.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@ connector types.

[role="screenshot"]
image::images/connector-filter-by-type.png[Filtering the connector list by types of connectors]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.

You can delete individual connectors using the trash icon. Alternatively, select
multiple connectors and delete them in bulk using the *Delete* button.

[role="screenshot"]
image::images/connector-delete.png[Deleting connectors individually or in bulk]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.

[NOTE]
============================================================================
Expand Down Expand Up @@ -165,7 +167,7 @@ button appears in *{connectors-ui}*.
image::images/connectors-with-missing-secrets.png[Connectors with missing secrets]

[float]
[[montoring-connectors]]
[[monitoring-connectors]]
=== Monitoring connectors

The <<task-manager-health-monitoring,Task Manager health API>> helps you understand the performance of all tasks in your environment.
Expand Down
Binary file modified docs/management/connectors/images/connector-delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/management/connectors/images/connector-listing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default function ({ getPageObject, getService, loadTestFile }: FtrProvide

loadTestFile(require.resolve('./stack_alerting'));
loadTestFile(require.resolve('./stack_cases'));
loadTestFile(require.resolve('./stack_connectors'));
loadTestFile(require.resolve('./observability_cases'));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export default function ({ loadTestFile, getService }: FtrProviderContext) {
});

loadTestFile(require.resolve('./list_view'));
loadTestFile(require.resolve('./connector_types'));
loadTestFile(require.resolve('./index_threshold_rule'));
loadTestFile(require.resolve('./tracking_containment_rule'));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await rules.api.deleteRule(ruleId);
});

it('connectors list screenshot', async () => {
await pageObjects.common.navigateToApp('connectors');
await pageObjects.header.waitUntilLoadingHasFinished();
await commonScreenshots.takeScreenshot(
'connector-listing',
screenshotDirectories,
1400,
1024
);
});

it('rules list screenshot', async () => {
await pageObjects.common.navigateToApp('triggersActions');
await pageObjects.header.waitUntilLoadingHasFinished();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const commonScreenshots = getService('commonScreenshots');
const screenshotDirectories = ['response_ops_docs', 'stack_alerting'];
const screenshotDirectories = ['response_ops_docs', 'stack_connectors'];
const pageObjects = getPageObjects(['common', 'header']);
const actions = getService('actions');
const testSubjects = getService('testSubjects');
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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 browser = getService('browser');
const find = getService('find');
const testSubjects = getService('testSubjects');
const screenshotDirectories = ['response_ops_docs', 'stack_connectors'];
const pageObjects = getPageObjects(['common', 'header']);

describe('connectors', function () {
it('connectors list screenshot', async () => {
await pageObjects.common.navigateToApp('connectors');
await pageObjects.header.waitUntilLoadingHasFinished();
await commonScreenshots.takeScreenshot(
'connector-listing',
screenshotDirectories,
1400,
1024
);

const searchBox = await find.byCssSelector('[data-test-subj="actionsList"] .euiFieldSearch');
await searchBox.click();
await searchBox.clearValue();
await searchBox.type('my actionTypeId:(.index)');
await searchBox.pressKeys(browser.keys.ENTER);
const typeFilter = await find.byCssSelector(
'[data-test-subj="actionsList"] .euiFilterButton'
);
await typeFilter.click();
await commonScreenshots.takeScreenshot(
'connector-filter-by-type',
screenshotDirectories,
1400,
1024
);

const clearSearchButton = await testSubjects.find('clearSearchButton');
await clearSearchButton.click();
const checkAllButton = await testSubjects.find('checkboxSelectAll');
await checkAllButton.click();
await commonScreenshots.takeScreenshot('connector-delete', screenshotDirectories, 1400, 1024);
});
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* 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, getService }: FtrProviderContext) {
const actions = getService('actions');
const browser = getService('browser');
const es = getService('es');
const rules = getService('rules');
const testIndex = `test-index`;

describe('stack connectors', function () {
before(async () => {
await browser.setWindowSize(1920, 1080);
await actions.api.createConnector({
name: 'server-log-connector',
config: {},
secrets: {},
connectorTypeId: '.server-log',
});

await es.indices.create({
index: testIndex,
body: {
mappings: {
properties: {
date_updated: {
type: 'date',
format: 'epoch_millis',
},
},
},
},
});
await actions.api.createConnector({
name: 'my-index-connector',
config: {
index: testIndex,
},
secrets: {},
connectorTypeId: '.index',
});
});

after(async () => {
await rules.api.deleteAllRules();
await actions.api.deleteAllConnectors();
await es.indices.delete({ index: testIndex });
});

loadTestFile(require.resolve('./connectors'));
loadTestFile(require.resolve('./connector_types'));
});
}

0 comments on commit 552e472

Please sign in to comment.