Skip to content

Commit

Permalink
[DOCS] Automate email-params-test.png, add title in connector table r…
Browse files Browse the repository at this point in the history
…ows (#155469)
  • Loading branch information
lcawl authored Apr 21, 2023
1 parent ec6bc2d commit e1b3bc2
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/management/connectors/action-types/email.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ as you're creating or editing the connector in {kib}. For example:

[role="screenshot"]
image::management/connectors/images/email-params-test.png[Email params test]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.

Email actions have the following configuration properties.

Expand Down
Binary file modified docs/management/connectors/images/email-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 @@ -234,6 +234,7 @@ const ActionsConnectorsList: React.FunctionComponent = () => {
<>
<EuiLink
data-test-subj={`edit${item.id}`}
title={name}
onClick={() => editItem(item, EditConnectorTabs.Configuration)}
key={item.id}
disabled={actionTypesIndex ? !actionTypesIndex[item.actionTypeId]?.enabled : true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,47 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const screenshotDirectories = ['response_ops_docs', 'stack_connectors'];
const pageObjects = getPageObjects(['common', 'header']);
const actions = getService('actions');
const testSubjects = getService('testSubjects');
const browser = getService('browser');
const comboBox = getService('comboBox');
const find = getService('find');
const testSubjects = getService('testSubjects');
const testIndex = `test-index`;
const indexDocument =
`{\n` +
`"rule_id": "{{rule.id}}",\n` +
`"rule_name": "{{rule.name}}",\n` +
`"alert_id": "{{alert.id}}",\n` +
`"context_message": "{{context.message}}"\n`;
const emailConnectorName = 'my-email-connector';

describe('connector types', function () {
let emailConnectorId: string;
before(async () => {
({ id: emailConnectorId } = await actions.api.createConnector({
name: emailConnectorName,
config: {
service: 'other',
from: '[email protected]',
host: 'some.non.existent.com',
port: 25,
},
secrets: {
user: 'bob',
password: 'supersecret',
},
connectorTypeId: '.email',
}));
});

beforeEach(async () => {
await pageObjects.common.navigateToApp('connectors');
await pageObjects.header.waitUntilLoadingHasFinished();
});

after(async () => {
await actions.api.deleteConnector(emailConnectorId);
});

it('server log connector screenshots', async () => {
await pageObjects.common.navigateToApp('connectors');
await pageObjects.header.waitUntilLoadingHasFinished();
Expand Down Expand Up @@ -69,5 +94,31 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const flyOutCancelButton = await testSubjects.find('euiFlyoutCloseButton');
await flyOutCancelButton.click();
});

it('test email connector screenshots', async () => {
const searchBox = await find.byCssSelector('[data-test-subj="actionsList"] .euiFieldSearch');
await searchBox.click();
await searchBox.clearValue();
await searchBox.type('my actionTypeId:(.email)');
await searchBox.pressKeys(browser.keys.ENTER);
const connectorList = await testSubjects.find('actionsTable');
const emailConnector = await connectorList.findByCssSelector(
`[title="${emailConnectorName}"]`
);
await emailConnector.click();
const testButton = await testSubjects.find('testConnectorTab');
await testButton.click();
await testSubjects.setValue('comboBoxSearchInput', '[email protected]');
await testSubjects.setValue('subjectInput', 'Test subject');
await testSubjects.setValue('messageTextArea', 'Enter message text');
/* timing issue sometimes happens with the combobox so we just try to set the subjectInput again */
await testSubjects.setValue('subjectInput', 'Test subject');
await commonScreenshots.takeScreenshot(
'email-params-test',
screenshotDirectories,
1400,
1024
);
});
});
}

0 comments on commit e1b3bc2

Please sign in to comment.