diff --git a/packages/kbn-doc-links/src/get_doc_links.ts b/packages/kbn-doc-links/src/get_doc_links.ts index 1ee240770c986..609ae54e6af25 100644 --- a/packages/kbn-doc-links/src/get_doc_links.ts +++ b/packages/kbn-doc-links/src/get_doc_links.ts @@ -472,6 +472,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => { createAlerts: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/create-alerts.html`, syntheticsCommandReference: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/synthetics-configuration.html#synthetics-configuration-playwright-options`, syntheticsProjectMonitors: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/synthetic-run-tests.html#synthetic-monitor-choose-project`, + syntheticsMigrateFromIntegration: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/synthetics-migrate-from-integration.html`, }, alerting: { guide: `${KIBANA_DOCS}create-and-manage-rules.html`, diff --git a/packages/kbn-doc-links/src/types.ts b/packages/kbn-doc-links/src/types.ts index b7056c42c5a6a..012c700c97bb0 100644 --- a/packages/kbn-doc-links/src/types.ts +++ b/packages/kbn-doc-links/src/types.ts @@ -354,6 +354,7 @@ export interface DocLinks { createAlerts: string; syntheticsCommandReference: string; syntheticsProjectMonitors: string; + syntheticsMigrateFromIntegration: string; }>; readonly alerting: Readonly<{ guide: string; diff --git a/x-pack/plugins/synthetics/e2e/journeys/uptime/private_locations/add_monitor_private_location.ts b/x-pack/plugins/synthetics/e2e/journeys/uptime/private_locations/add_monitor_private_location.ts index 19a2d54a79458..9960ff1cc207a 100644 --- a/x-pack/plugins/synthetics/e2e/journeys/uptime/private_locations/add_monitor_private_location.ts +++ b/x-pack/plugins/synthetics/e2e/journeys/uptime/private_locations/add_monitor_private_location.ts @@ -7,15 +7,34 @@ import { journey, step, expect, before } from '@elastic/synthetics'; import { assertText, byTestId, TIMEOUT_60_SEC } from '@kbn/observability-plugin/e2e/utils'; import { recordVideo } from '@kbn/observability-plugin/e2e/record_video'; +import { cleanTestMonitors } from '../../synthetics/services/add_monitor'; import { monitorManagementPageProvider } from '../../../page_objects/uptime/monitor_management'; -journey('AddPrivateLocationMonitor', async ({ page, params: { kibanaUrl } }) => { +journey('AddPrivateLocationMonitor', async ({ page, params }) => { recordVideo(page); + page.setDefaultTimeout(TIMEOUT_60_SEC.timeout); + const kibanaUrl = params.kibanaUrl; + const uptime = monitorManagementPageProvider({ page, kibanaUrl }); + let monitorId: string; + before(async () => { - await uptime.waitForLoadingToFinish(); + await cleanTestMonitors(params); + page.on('request', (evt) => { + if ( + evt.resourceType() === 'fetch' && + evt.url().includes('/internal/uptime/service/monitors?preserve_namespace=true') + ) { + evt + .response() + ?.then((res) => res?.json()) + .then((res) => { + monitorId = res.id; + }); + } + }); }); step('Go to monitor-management', async () => { @@ -39,7 +58,7 @@ journey('AddPrivateLocationMonitor', async ({ page, params: { kibanaUrl } }) => await page.click('input[name="name"]'); await page.fill('input[name="name"]', 'Private location monitor'); - await page.click('label:has-text("Test private location Private")', TIMEOUT_60_SEC); + await page.click('label:has-text("Test private location Private")'); await page.selectOption('select', 'http'); await page.click(byTestId('syntheticsUrlField')); await page.fill(byTestId('syntheticsUrlField'), 'https://www.google.com'); @@ -66,7 +85,9 @@ journey('AddPrivateLocationMonitor', async ({ page, params: { kibanaUrl } }) => step('Click text=Edit Elastic Synthetics integration', async () => { await assertText({ page, text: 'This table contains 1 rows out of 1 rows; Page 1 of 1.' }); await page.click('[data-test-subj="integrationNameLink"]'); - await page.click('text=Edit in uptime'); + const btn = await page.locator(byTestId('syntheticsEditMonitorButton')); + expect(await btn.getAttribute('href')).toBe(`/app/synthetics/edit-monitor/${monitorId}`); + await btn.click(); await page.click('text=Private location monitor'); }); }); diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_edit_extension_wrapper.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_edit_extension_wrapper.tsx index 5c1f6dd7c1159..3ad8cc305ad0d 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_edit_extension_wrapper.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_edit_extension_wrapper.tsx @@ -104,10 +104,15 @@ export const SyntheticsPolicyEditExtensionWrapper = memo -

{EDIT_IN_UPTIME_DESC}

+

{EDIT_IN_SYNTHETICS_DESC}

{/* TODO Add a link to exact monitor*/} - - {EDIT_IN_UPTIME_LABEL} + + {EDIT_IN_SYNTHETICS_LABEL} ); @@ -143,10 +148,13 @@ export const SyntheticsPolicyEditExtensionWrapper = memo