diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx b/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx index 1b3028a0283ed..b9867b3effe6f 100644 --- a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx +++ b/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx @@ -220,7 +220,7 @@ export default function Embeddable(props: ExploratoryEmbeddableComponentProps) { /> {isSaveOpen && attributesJSON && ( setIsSaveOpen(false)} // if we want to do anything after the viz is saved // right now there is no action, so an empty function diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/index.ts b/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/index.ts index 1e2b17b34e096..431e99f97ea41 100644 --- a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/index.ts +++ b/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/index.ts @@ -25,3 +25,4 @@ export * from './monitor_details_page/monitor_summary.journey'; export * from './test_run_details.journey'; export * from './step_details.journey'; export * from './project_monitor_read_only.journey'; +export * from './overview_save_lens_visualization.journey'; diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/overview_save_lens_visualization.journey.ts b/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/overview_save_lens_visualization.journey.ts new file mode 100644 index 0000000000000..a380f1c41bbe8 --- /dev/null +++ b/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/overview_save_lens_visualization.journey.ts @@ -0,0 +1,55 @@ +/* + * 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 { before, expect, journey, step, after } from '@elastic/synthetics'; +import { syntheticsAppPageProvider } from '../page_objects/synthetics_app'; +import { SyntheticsServices } from './services/synthetics_services'; + +journey('OverviewSaveLensVisualization', async ({ page, params }) => { + const syntheticsApp = syntheticsAppPageProvider({ page, kibanaUrl: params.kibanaUrl, params }); + const syntheticsService = new SyntheticsServices(params); + + before(async () => { + await syntheticsService.cleaUp(); + }); + + after(async () => { + await syntheticsService.cleaUp(); + }); + + step('Go to Monitors overview page', async () => { + await syntheticsApp.navigateToOverview(true, 15); + }); + + step('Create test monitor', async () => { + await syntheticsService.addTestMonitor('Test Overview Save Lens Visualization Monitor', { + type: 'http', + urls: 'https://www.google.com', + locations: ['us_central'], + }); + await page.getByTestId('syntheticsRefreshButtonButton').click(); + }); + + step('Open the save lens visualization', async () => { + await page + .getByTestId('overviewErrorsSparklines') + .getByTestId('embeddablePanelHoverActions-') + .hover(); + + await page + .getByTestId('overviewErrorsSparklines') + .getByTestId('embeddablePanelToggleMenuIcon') + .click(); + await page.getByTestId('embeddablePanelAction-expViewSave').click(); + }); + + step('The attributes are correctly passed to the save lens visualization modal', async () => { + expect(await page.getByTestId('savedObjectTitle').inputValue()).toBe( + 'Prefilled from exploratory view app' + ); + }); +}); diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_errors/overview_errors_sparklines.tsx b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_errors/overview_errors_sparklines.tsx index 41d6a5bc34d7d..25e51e44ffdf7 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_errors/overview_errors_sparklines.tsx +++ b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_errors/overview_errors_sparklines.tsx @@ -30,6 +30,7 @@ export const OverviewErrorsSparklines = ({ from, to }: Props) => { return (