[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 <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Justin Kambic 2020-04-06 16:46:32 -04:00 committed by GitHub
parent 8cbbfda2c6
commit ba68fb17d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

View file

@ -104,7 +104,10 @@ const Application = (props: UptimeAppProps) => {
<UptimeAlertsContextProvider>
<EuiPage className="app-wrapper-panel " data-test-subj="uptimeApp">
<main>
<UptimeAlertsFlyoutWrapper />
<UptimeAlertsFlyoutWrapper
alertTypeId="xpack.uptime.alerts.monitorStatus"
canChangeTrigger={false}
/>
<PageRouter autocomplete={plugins.data.autocomplete} />
</main>
</EuiPage>

View file

@ -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);

View file

@ -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) {