[DOCS] Automate rule-types-index-threshold-example-alerts.png (#152618)

This commit is contained in:
Lisa Cawley 2023-03-07 08:43:49 -08:00 committed by GitHub
parent 8eb73eab9f
commit b6cff1ad72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 KiB

After

Width:  |  Height:  |  Size: 231 KiB

Before After
Before After

View file

@ -109,6 +109,7 @@ The unique action variables that you can use in the notification are listed in <
+
[role="screenshot"]
image::user/alerting/images/rule-types-index-threshold-example-alerts.png[View the list of alerts for the rule]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.
. Delete or disable this example rule when it's no longer useful. In the detailed rule view, select *Delete rule* from the actions menu.

View file

@ -19,13 +19,15 @@ export function RulesAPIServiceProvider({ getService }: FtrProviderContext) {
params,
ruleTypeId,
schedule,
actions = [],
}: {
consumer: string;
name: string;
notifyWhen: string;
notifyWhen?: string;
params: Record<string, unknown>;
ruleTypeId: string;
schedule: Record<string, unknown>;
actions?: any[];
}) {
log.debug(`Create basic rule...`);
const { body: createdRule } = await kbnSupertest
@ -38,6 +40,7 @@ export function RulesAPIServiceProvider({ getService }: FtrProviderContext) {
params,
rule_type_id: ruleTypeId,
schedule,
actions,
})
.expect(200);
return createdRule;

View file

@ -16,13 +16,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const pageObjects = getPageObjects(['common', 'header']);
const screenshotDirectories = ['response_ops_docs', 'stack_alerting'];
const ruleName = 'kibana sites - high egress';
describe('index threshold rule', function () {
it('create rule screenshot', async () => {
await pageObjects.common.navigateToApp('triggersActions');
await pageObjects.header.waitUntilLoadingHasFinished();
await rules.common.clickCreateAlertButton();
await testSubjects.setValue('ruleNameInput', 'kibana sites - high egress');
await testSubjects.setValue('ruleNameInput', ruleName);
await testSubjects.click('tagsComboBox');
await testSubjects.setValue('tagsComboBox', 'sample-data');
await testSubjects.click('solutionsFilterButton');
@ -130,12 +131,24 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
1400,
1024
);
/*
* const saveButton = await testSubjects.find('saveRuleButton');
* await saveButton.click();
*/
const saveButton = await testSubjects.find('saveRuleButton');
await saveButton.click();
const flyOutCancelButton = await testSubjects.find('euiFlyoutCloseButton');
await flyOutCancelButton.click();
await pageObjects.common.navigateToApp('triggersActions');
await pageObjects.header.waitUntilLoadingHasFinished();
await testSubjects.setValue('ruleSearchField', ruleName);
const rulesList = await testSubjects.find('rulesList');
const alertRule = await rulesList.findByCssSelector(`[title="${ruleName}"]`);
await alertRule.click();
await pageObjects.header.waitUntilLoadingHasFinished();
await commonScreenshots.takeScreenshot(
'rule-types-index-threshold-example-alerts',
screenshotDirectories,
1400,
1024
);
});
});
}

View file

@ -33,6 +33,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
ruleTypeId: '.index-threshold',
schedule: { interval: '1m' },
tags: [],
actions: [],
};
before(async () => {