-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '7.17' into backport/7.17/pr-123464
- Loading branch information
Showing
18 changed files
with
337 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export * from './tls_alert_flyouts_in_alerting_app'; | ||
export * from './status_alert_flyouts_in_alerting_app'; |
67 changes: 67 additions & 0 deletions
67
x-pack/plugins/uptime/e2e/journeys/alerts/status_alert_flyouts_in_alerting_app.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { journey, step, expect, before } from '@elastic/synthetics'; | ||
import { assertText, byTestId, loginToKibana, waitForLoadingToFinish } from '../utils'; | ||
|
||
journey('StatusFlyoutInAlertingApp', async ({ page, params }) => { | ||
before(async () => { | ||
await waitForLoadingToFinish({ page }); | ||
}); | ||
|
||
const baseUrl = `${params.kibanaUrl}/app/management/insightsAndAlerting/triggersActions/rules`; | ||
|
||
step('Go to Alerting app', async () => { | ||
await page.goto(`${baseUrl}`, { | ||
waitUntil: 'networkidle', | ||
}); | ||
await loginToKibana({ page }); | ||
}); | ||
|
||
step('Open monitor status flyout', async () => { | ||
await page.click(byTestId('createFirstAlertButton')); | ||
await waitForLoadingToFinish({ page }); | ||
await page.click(byTestId('"xpack.uptime.alerts.monitorStatus-SelectOption"')); | ||
await waitForLoadingToFinish({ page }); | ||
await assertText({ page, text: 'This alert will apply to approximately 0 monitors.' }); | ||
}); | ||
|
||
step('can add filters', async () => { | ||
await page.click('text=Add filter'); | ||
await page.click(byTestId('"uptimeAlertAddFilter.monitor.type"')); | ||
await page.click(byTestId('"uptimeCreateStatusAlert.filter_scheme"')); | ||
}); | ||
|
||
step('can open query bar', async () => { | ||
await page.click(byTestId('"xpack.uptime.alerts.monitorStatus.filterBar"')); | ||
|
||
await page.fill(byTestId('"xpack.uptime.alerts.monitorStatus.filterBar"'), 'monitor.type : '); | ||
|
||
await waitForLoadingToFinish({ page }); | ||
|
||
await assertText({ page, text: 'http' }); | ||
|
||
const suggestionItem = await page.$(byTestId('autoCompleteSuggestionText')); | ||
expect(await suggestionItem?.textContent()).toBe('"http" '); | ||
|
||
await page.click(byTestId('euiFlyoutCloseButton')); | ||
await page.click(byTestId('confirmModalConfirmButton')); | ||
}); | ||
|
||
step('Open tls alert flyout', async () => { | ||
await page.click(byTestId('createFirstAlertButton')); | ||
await waitForLoadingToFinish({ page }); | ||
await page.click(byTestId('"xpack.uptime.alerts.tlsCertificate-SelectOption"')); | ||
await waitForLoadingToFinish({ page }); | ||
await assertText({ page, text: 'has a certificate expiring within' }); | ||
}); | ||
|
||
step('Tls alert flyout has setting values', async () => { | ||
await assertText({ page, text: '30 days' }); | ||
await assertText({ page, text: '730 days' }); | ||
}); | ||
}); |
37 changes: 37 additions & 0 deletions
37
x-pack/plugins/uptime/e2e/journeys/alerts/tls_alert_flyouts_in_alerting_app.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { journey, step, before } from '@elastic/synthetics'; | ||
import { assertText, byTestId, loginToKibana, waitForLoadingToFinish } from '../utils'; | ||
|
||
journey('TlsFlyoutInAlertingApp', async ({ page, params }) => { | ||
before(async () => { | ||
await waitForLoadingToFinish({ page }); | ||
}); | ||
|
||
const baseUrl = `${params.kibanaUrl}/app/management/insightsAndAlerting/triggersActions/rules`; | ||
|
||
step('Go to Alerting app', async () => { | ||
await page.goto(`${baseUrl}`, { | ||
waitUntil: 'networkidle', | ||
}); | ||
await loginToKibana({ page }); | ||
}); | ||
|
||
step('Open tls alert flyout', async () => { | ||
await page.click(byTestId('createFirstAlertButton')); | ||
await waitForLoadingToFinish({ page }); | ||
await page.click(byTestId('"xpack.uptime.alerts.tlsCertificate-SelectOption"')); | ||
await waitForLoadingToFinish({ page }); | ||
await assertText({ page, text: 'has a certificate expiring within' }); | ||
}); | ||
|
||
step('Tls alert flyout has setting values', async () => { | ||
await assertText({ page, text: '30 days' }); | ||
await assertText({ page, text: '730 days' }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
*/ | ||
|
||
export * from './uptime.journey'; | ||
export * from './alerts'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { expect, Page } from '@elastic/synthetics'; | ||
|
||
export async function waitForLoadingToFinish({ page }: { page: Page }) { | ||
while (true) { | ||
if ((await page.$(byTestId('kbnLoadingMessage'))) === null) break; | ||
await page.waitForTimeout(5 * 1000); | ||
} | ||
} | ||
|
||
export async function loginToKibana({ page }: { page: Page }) { | ||
await page.fill('[data-test-subj=loginUsername]', 'elastic', { | ||
timeout: 60 * 1000, | ||
}); | ||
await page.fill('[data-test-subj=loginPassword]', 'changeme'); | ||
|
||
await page.click('[data-test-subj=loginSubmit]'); | ||
|
||
await waitForLoadingToFinish({ page }); | ||
} | ||
|
||
export const byTestId = (testId: string) => { | ||
return `[data-test-subj=${testId}]`; | ||
}; | ||
|
||
export const assertText = async ({ page, text }: { page: Page; text: string }) => { | ||
await page.waitForSelector(`text=${text}`, { timeout: 60 * 1000 }); | ||
expect(await page.$(`text=${text}`)).toBeTruthy(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.