From 3dc838ad6f6bcfe9ac595ca2b5190f55bec713b1 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Tue, 31 Mar 2020 13:26:45 -0400 Subject: [PATCH 1/3] Default uptime alert type and disable changing type. --- x-pack/legacy/plugins/uptime/public/uptime_app.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/uptime/public/uptime_app.tsx b/x-pack/legacy/plugins/uptime/public/uptime_app.tsx index fa2998532d145..dafb20dc9c323 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) => {
- +
From 85b99e547eb294cb43910740ff1676e94e53ae92 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Tue, 31 Mar 2020 17:18:06 -0400 Subject: [PATCH 2/3] Update functional test to handle new UI flow. --- x-pack/test/functional/page_objects/uptime_page.ts | 6 +++++- x-pack/test/functional/services/uptime.ts | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/x-pack/test/functional/page_objects/uptime_page.ts b/x-pack/test/functional/page_objects/uptime_page.ts index 0b8e994ba8095..cafdb5fe15329 100644 --- a/x-pack/test/functional/page_objects/uptime_page.ts +++ b/x-pack/test/functional/page_objects/uptime_page.ts @@ -120,6 +120,7 @@ export function UptimePageProvider({ getPageObjects, getService }: FtrProviderCo alertTags, alertThrottleInterval, alertTimerangeSelection, + alertType, filters, }: { alertName: string; @@ -128,11 +129,14 @@ export function UptimePageProvider({ getPageObjects, getService }: FtrProviderCo alertThrottleInterval: string; alertNumTimes: string; alertTimerangeSelection: string; + alertType?: string; filters?: string; }) { const { alerts, setKueryBarText } = uptimeService; 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.ts b/x-pack/test/functional/services/uptime.ts index 5a24a51f967fd..a8c8b2b4311af 100644 --- a/x-pack/test/functional/services/uptime.ts +++ b/x-pack/test/functional/services/uptime.ts @@ -48,8 +48,8 @@ export function UptimeProvider({ 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(type: string) { + return testSubjects.click(type, 5000); }, async setAlertTags(tags: string[]) { for (let i = 0; i < tags.length; i += 1) { From cd47049af1bc57ca298c863ddc478ba5411a4856 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Thu, 2 Apr 2020 15:19:17 -0400 Subject: [PATCH 3/3] Fix type error. --- x-pack/test/functional/services/uptime/alerts.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) {