From b69c619c2eb2fade5d6bccf5136de2f3d5e04528 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Mon, 16 Oct 2023 12:10:45 -0700 Subject: [PATCH] [DOCS] Automate more anomaly detection rule screenshots (#168900) --- .../generate_anomaly_alerts.ts | 35 +++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/x-pack/test/screenshot_creation/apps/ml_docs/anomaly_detection/generate_anomaly_alerts.ts b/x-pack/test/screenshot_creation/apps/ml_docs/anomaly_detection/generate_anomaly_alerts.ts index 57bae974ce273..cec6ed8528a10 100644 --- a/x-pack/test/screenshot_creation/apps/ml_docs/anomaly_detection/generate_anomaly_alerts.ts +++ b/x-pack/test/screenshot_creation/apps/ml_docs/anomaly_detection/generate_anomaly_alerts.ts @@ -123,6 +123,18 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { 1920, 1400 ); + await ml.alerting.selectSlackConnectorType(); + await ml.testExecution.logTestStep('should open connectors'); + await ml.alerting.clickCreateConnectorButton(); + await ml.alerting.setConnectorName('test-connector'); + await ml.alerting.setWebhookUrl('https://www.elastic.co'); + await ml.alerting.clickSaveActionButton(); + await commonScreenshots.takeScreenshot( + 'ml-health-check-action', + screenshotDirectories, + 1920, + 1400 + ); await ml.alerting.clickCancelSaveRuleButton(); await pageObjects.triggersActionsUI.clickCreateAlertButton(); @@ -150,12 +162,13 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { 1920, 1400 ); - await ml.alerting.selectSlackConnectorType(); - await ml.testExecution.logTestStep('should open connectors'); - await ml.alerting.clickCreateConnectorButton(); - await ml.alerting.setConnectorName('test-connector'); - await ml.alerting.setWebhookUrl('https://www.elastic.co'); - await ml.alerting.clickSaveActionButton(); + await testSubjects.click('.slack-alerting-ActionTypeSelectOption'); + await commonScreenshots.takeScreenshot( + 'ml-anomaly-alert-action-score-matched', + screenshotDirectories, + 1920, + 1400 + ); await ml.alerting.openAddRuleVariable(); await ml.testExecution.logTestStep('take screenshot'); await commonScreenshots.takeScreenshot( @@ -164,6 +177,16 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { 1920, 1400 ); + const actionFrequency = await testSubjects.find('summaryOrPerRuleSelect'); + await actionFrequency.click(); + const actionSummary = await testSubjects.find('actionNotifyWhen-option-summary'); + await actionSummary.click(); + await commonScreenshots.takeScreenshot( + 'ml-anomaly-alert-action-summary', + screenshotDirectories, + 1920, + 1400 + ); }); }); });