-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOCS] Automate email-params-test.png, add title in connector table r…
…ows (#155469)
- Loading branch information
Showing
4 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(); | ||
|
@@ -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 | ||
); | ||
}); | ||
}); | ||
} |