From ba68fb17d34056423ca7d72ddfb2f1050333c113 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Mon, 6 Apr 2020 16:46:32 -0400 Subject: [PATCH] [Uptime] Default uptime alert type and disable changing type (#62028) (#62627) * Default uptime alert type and disable changing type. * Update functional test to handle new UI flow. * Fix type error. Co-authored-by: Elastic Machine Co-authored-by: Elastic Machine --- x-pack/legacy/plugins/uptime/public/uptime_app.tsx | 5 ++++- x-pack/test/functional/page_objects/uptime_page.ts | 6 +++++- x-pack/test/functional/services/uptime/alerts.ts | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/x-pack/legacy/plugins/uptime/public/uptime_app.tsx b/x-pack/legacy/plugins/uptime/public/uptime_app.tsx index aab00933f1c31..5400cf8e1ec16 100644 --- a/x-pack/legacy/plugins/uptime/public/uptime_app.tsx +++ b/x-pack/legacy/plugins/uptime/public/uptime_app.tsx @@ -104,7 +104,10 @@ const Application = (props: UptimeAppProps) => {
- +
diff --git a/x-pack/test/functional/page_objects/uptime_page.ts b/x-pack/test/functional/page_objects/uptime_page.ts index fcf2b77dbd624..39c3c46adddbb 100644 --- a/x-pack/test/functional/page_objects/uptime_page.ts +++ b/x-pack/test/functional/page_objects/uptime_page.ts @@ -105,6 +105,7 @@ export function UptimePageProvider({ getPageObjects, getService }: FtrProviderCo alertTags, alertThrottleInterval, alertTimerangeSelection, + alertType, filters, }: { alertName: string; @@ -113,11 +114,14 @@ export function UptimePageProvider({ getPageObjects, getService }: FtrProviderCo alertThrottleInterval: string; alertNumTimes: string; alertTimerangeSelection: string; + alertType?: string; filters?: string; }) { const { setKueryBarText } = commonService; await alerts.openFlyout(); - await alerts.openMonitorStatusAlertType(); + if (alertType) { + await alerts.openMonitorStatusAlertType(alertType); + } await alerts.setAlertName(alertName); await alerts.setAlertTags(alertTags); await alerts.setAlertInterval(alertInterval); diff --git a/x-pack/test/functional/services/uptime/alerts.ts b/x-pack/test/functional/services/uptime/alerts.ts index 5ee444adec82f..3a8193ff3d327 100644 --- a/x-pack/test/functional/services/uptime/alerts.ts +++ b/x-pack/test/functional/services/uptime/alerts.ts @@ -15,8 +15,8 @@ export function UptimeAlertsProvider({ getService }: FtrProviderContext) { await testSubjects.click('xpack.uptime.alertsPopover.toggleButton', 5000); await testSubjects.click('xpack.uptime.toggleAlertFlyout', 5000); }, - async openMonitorStatusAlertType() { - return testSubjects.click('xpack.uptime.alerts.monitorStatus-SelectOption', 5000); + async openMonitorStatusAlertType(alertType: string) { + return testSubjects.click(`xpack.uptime.alerts.${alertType}-SelectOption`, 5000); }, async setAlertTags(tags: string[]) { for (let i = 0; i < tags.length; i += 1) {