Skip to content

Commit

Permalink
[DOCS] Automate Tines connector screenshots (#166313)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3df2c4f)
  • Loading branch information
lcawl committed Dec 20, 2023
1 parent 3418996 commit e4603c2
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 11 deletions.
14 changes: 3 additions & 11 deletions docs/management/connectors/action-types/tines.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand All @@ -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]]
Expand Down
Binary file removed docs/management/connectors/images/tines-alerting.png
Binary file not shown.
Binary file modified docs/management/connectors/images/tines-connector.png
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/tines-params-test.png
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 @@ -64,6 +64,7 @@ export default function ({ loadTestFile, getService }: FtrProviderContext) {
loadTestFile(require.resolve('./server_log_connector'));
loadTestFile(require.resolve('./servicenow_itom_connector'));
loadTestFile(require.resolve('./slack_connector'));
loadTestFile(require.resolve('./tines_connector'));
loadTestFile(require.resolve('./webhook_connector'));
loadTestFile(require.resolve('./xmatters_connector'));
});
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 {
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', '[email protected]');
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');
});
});
}

0 comments on commit e4603c2

Please sign in to comment.