[Discover] Add fixes for flaky search source alert test (#137619) (#138294)

(cherry picked from commit ae151afbba)

# Conflicts:
#	x-pack/test/functional_with_es_ssl/apps/discover/search_source_alert.ts
This commit is contained in:
Davis McPhee 2022-08-08 15:16:46 -03:00 committed by GitHub
parent c67ed21392
commit 97305e92c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -146,10 +146,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await testSubjects.click('discoverAlertsButton');
await testSubjects.click('discoverCreateAlertButton');
await testSubjects.setValue('ruleNameInput', alertName);
await retry.waitFor('rule name value is correct', async () => {
await testSubjects.setValue('ruleNameInput', alertName);
const ruleName = await testSubjects.getAttribute('ruleNameInput', 'value');
return ruleName === alertName;
});
await testSubjects.click('thresholdPopover');
await testSubjects.setValue('alertThresholdInput', '3');
await testSubjects.click('.index-ActionTypeSelectOption');
await retry.waitFor('actions accordion to exist', async () => {
await testSubjects.click('.index-alerting-ActionTypeSelectOption');
return await testSubjects.exists('alertActionAccordion-0');
});
await monacoEditor.setCodeEditorValue(`{
"rule_id": "{{ruleId}}",
@ -226,7 +233,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.header.waitUntilLoadingHasFinished();
};
// FLAKY: https://github.com/elastic/kibana/issues/135065
describe.skip('Search source Alert', () => {
before(async () => {
await security.testUser.setRoles(['discover_alert']);