[DOCS] Automate Tines connector screenshots (#166313)

This commit is contained in:
Lisa Cawley 2023-12-19 20:31:11 -08:00 committed by GitHub
parent 2486ed5bd1
commit 3df2c4f966
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 56 additions and 11 deletions

View file

@ -19,6 +19,7 @@ or as needed when you're creating a rule. For example:
[role="screenshot"]
image::management/connectors/images/tines-connector.png[Tines connector]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.
[float]
[[tines-connector-configuration]]
@ -34,23 +35,14 @@ API Token:: A Tines API token created by the user. For more information, refer
[[tines-action-parameters]]
=== Test connectors
Tines actions have the following parameters.
Story:: The Story to send the events to.
Webhook:: The Webhook action from the previous story that will receive the events, it is the data entry point.
You can test connectors with the <<execute-connector-api,run connector API>> or
as you're creating or editing the connector in {kib}. For example:
[role="screenshot"]
image::management/connectors/images/tines-params-test.png[Tines params test]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.
Once the Tines connector has been configured in an alerting rule:
[role="screenshot"]
image::management/connectors/images/tines-alerting.png[Tines rule alert]
It will send a POST request to the Tines webhook action on every action that runs with at least one result.
If you create a rule action that uses the Tines connector, you can likewise configure the POST request that is sent to the Tines webhook action when the rule conditions are met.
[float]
[[webhookUrlFallback-tines-configuration]]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 155 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 126 KiB

Before After
Before After

View file

@ -65,6 +65,7 @@ export default function ({ loadTestFile, getService }: FtrProviderContext) {
loadTestFile(require.resolve('./servicenow_itom_connector'));
loadTestFile(require.resolve('./servicenow_itsm_connector'));
loadTestFile(require.resolve('./slack_connector'));
loadTestFile(require.resolve('./tines_connector'));
loadTestFile(require.resolve('./webhook_connector'));
loadTestFile(require.resolve('./xmatters_connector'));
});

View file

@ -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 {
ExternalServiceSimulator,
getExternalServiceSimulatorPath,
} from '@kbn/actions-simulators-plugin/server/plugin';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const commonScreenshots = getService('commonScreenshots');
const screenshotDirectories = ['response_ops_docs', 'stack_connectors'];
const pageObjects = getPageObjects(['common', 'header']);
const actions = getService('actions');
const kibanaServer = getService('kibanaServer');
const testSubjects = getService('testSubjects');
let simulatorUrl: string;
let editSimulatorUrl: string;
describe('tines connector', function () {
before(async () => {
simulatorUrl = kibanaServer.resolveUrl(
getExternalServiceSimulatorPath(ExternalServiceSimulator.TINES)
);
editSimulatorUrl = simulatorUrl.replace('/elastic:changeme@', '/');
});
beforeEach(async () => {
await pageObjects.common.navigateToApp('connectors');
await pageObjects.header.waitUntilLoadingHasFinished();
});
it('tines connector screenshots', async () => {
await pageObjects.common.navigateToApp('connectors');
await pageObjects.header.waitUntilLoadingHasFinished();
await actions.common.openNewConnectorForm('tines');
await testSubjects.setValue('nameInput', 'Tines test connector');
await testSubjects.setValue('config.url-input', editSimulatorUrl);
await testSubjects.setValue('secrets.email-input', 'test@example.com');
await testSubjects.setValue('secrets.token-input', 'tester');
await commonScreenshots.takeScreenshot('tines-connector', screenshotDirectories);
await testSubjects.click('create-connector-flyout-save-test-btn');
await pageObjects.common.clearAllToasts();
await commonScreenshots.takeScreenshot('tines-params-test', screenshotDirectories);
await testSubjects.click('euiFlyoutCloseButton');
});
});
}