From 2c3e628253871a061615a7a15e11939badfa2812 Mon Sep 17 00:00:00 2001 From: Drew Tate Date: Thu, 29 Jan 2026 09:30:23 -0700 Subject: [PATCH 1/3] standardize dashboard performance journeys --- .../journeys_e2e/data_stress_test_lens.ts | 16 +++-- .../ecommerce_dashboard_map_only.ts | 20 ++---- .../ecommerce_dashboard_saved_search_only.ts | 20 ++---- .../ecommerce_dashboard_tsvb_gauge_only.ts | 20 ++---- .../journeys_e2e/flight_dashboard.ts | 20 ++---- .../journeys_e2e/utils/dashboard_journey.ts | 70 +++++++++++++++++++ .../journeys_e2e/web_logs_dashboard.ts | 20 ++---- .../journeys_e2e/web_logs_dashboard_esql.ts | 20 ++---- .../web_logs_dashboard_esql_long_running.ts | 20 ++---- .../web_logs_dashboard_long_running.ts | 20 ++---- 10 files changed, 128 insertions(+), 118 deletions(-) create mode 100644 x-pack/performance/journeys_e2e/utils/dashboard_journey.ts diff --git a/x-pack/performance/journeys_e2e/data_stress_test_lens.ts b/x-pack/performance/journeys_e2e/data_stress_test_lens.ts index d7eeee7df8440..ee926b7f2cc91 100644 --- a/x-pack/performance/journeys_e2e/data_stress_test_lens.ts +++ b/x-pack/performance/journeys_e2e/data_stress_test_lens.ts @@ -5,13 +5,15 @@ * 2.0. */ -import { Journey } from '@kbn/journeys'; +import { createDashboardJourney } from './utils/dashboard_journey'; -export const journey = new Journey({ - kbnArchives: ['src/platform/test/functional/fixtures/kbn_archiver/stress_test'], +export const journey = createDashboardJourney({ esArchives: ['src/platform/test/functional/fixtures/es_archiver/stress_test'], -}).step('Go to dashboard', async ({ page, kbnUrl, kibanaServer, kibanaPage }) => { - await kibanaServer.uiSettings.update({ 'histogram:maxBars': 100 }); - await page.goto(kbnUrl.get(`/app/dashboards#/view/92b143a0-2e9c-11ed-b1b6-a504560b392c`)); - await kibanaPage.waitForVisualizations({ count: 1 }); + kbnArchives: ['src/platform/test/functional/fixtures/kbn_archiver/stress_test'], + dashboardName: 'Stress Test Dashboard', + dashboardLinkSubj: 'dashboardListingTitleLink-Stresstest', + visualizationCount: 1, + setup: async (kibanaServer) => { + await kibanaServer.uiSettings.update({ 'histogram:maxBars': 100 }); + }, }); diff --git a/x-pack/performance/journeys_e2e/ecommerce_dashboard_map_only.ts b/x-pack/performance/journeys_e2e/ecommerce_dashboard_map_only.ts index 269ccc86f72eb..b104a490b2b6c 100644 --- a/x-pack/performance/journeys_e2e/ecommerce_dashboard_map_only.ts +++ b/x-pack/performance/journeys_e2e/ecommerce_dashboard_map_only.ts @@ -5,22 +5,16 @@ * 2.0. */ -import { Journey } from '@kbn/journeys'; -import { subj } from '@kbn/test-subj-selector'; +import { createDashboardJourney } from './utils/dashboard_journey'; -export const journey = new Journey({ +export const journey = createDashboardJourney({ esArchives: ['x-pack/performance/es_archives/sample_data_ecommerce_many_fields'], kbnArchives: ['x-pack/performance/kbn_archives/ecommerce_map_only_dashboard'], -}) - - .step('Go to Dashboards Page', async ({ page, kbnUrl, kibanaPage }) => { - await page.goto(kbnUrl.get(`/app/dashboards`)); - await kibanaPage.waitForListViewTable(); - }) - - .step('Go to Ecommerce No Map Dashboard', async ({ page }) => { - await page.click(subj('dashboardListingTitleLink-[eCommerce]-Map-Only')); + dashboardName: 'Ecommerce Dashboard with Map only', + dashboardLinkSubj: 'dashboardListingTitleLink-[eCommerce]-Map-Only', + loadCompleteAwaiter: async (page, kibanaPage) => { await page.waitForSelector( 'div[data-title="[eCommerce] Orders by Country"][data-render-complete="true"]' ); - }); + }, +}); diff --git a/x-pack/performance/journeys_e2e/ecommerce_dashboard_saved_search_only.ts b/x-pack/performance/journeys_e2e/ecommerce_dashboard_saved_search_only.ts index e22296a0d4306..b72d32db28472 100644 --- a/x-pack/performance/journeys_e2e/ecommerce_dashboard_saved_search_only.ts +++ b/x-pack/performance/journeys_e2e/ecommerce_dashboard_saved_search_only.ts @@ -5,20 +5,12 @@ * 2.0. */ -import { Journey } from '@kbn/journeys'; -import { subj } from '@kbn/test-subj-selector'; +import { createDashboardJourney } from './utils/dashboard_journey'; -export const journey = new Journey({ +export const journey = createDashboardJourney({ esArchives: ['x-pack/performance/es_archives/sample_data_ecommerce_many_fields'], kbnArchives: ['x-pack/performance/kbn_archives/ecommerce_saved_search_only_dashboard'], -}) - - .step('Go to Dashboards Page', async ({ page, kbnUrl, kibanaPage }) => { - await page.goto(kbnUrl.get(`/app/dashboards`)); - await kibanaPage.waitForListViewTable(); - }) - - .step('Go to Ecommerce Dashboard with Saved Search only', async ({ page, kibanaPage }) => { - await page.click(subj('dashboardListingTitleLink-[eCommerce]-Saved-Search-Dashboard')); - await kibanaPage.waitForVisualizations({ count: 1 }); - }); + dashboardName: 'Ecommerce Dashboard with Saved Search only', + dashboardLinkSubj: 'dashboardListingTitleLink-[eCommerce]-Saved-Search-Dashboard', + visualizationCount: 1, +}); diff --git a/x-pack/performance/journeys_e2e/ecommerce_dashboard_tsvb_gauge_only.ts b/x-pack/performance/journeys_e2e/ecommerce_dashboard_tsvb_gauge_only.ts index 2c80359aa37ef..74893fd3517c3 100644 --- a/x-pack/performance/journeys_e2e/ecommerce_dashboard_tsvb_gauge_only.ts +++ b/x-pack/performance/journeys_e2e/ecommerce_dashboard_tsvb_gauge_only.ts @@ -5,20 +5,12 @@ * 2.0. */ -import { Journey } from '@kbn/journeys'; -import { subj } from '@kbn/test-subj-selector'; +import { createDashboardJourney } from './utils/dashboard_journey'; -export const journey = new Journey({ +export const journey = createDashboardJourney({ esArchives: ['x-pack/performance/es_archives/sample_data_ecommerce_many_fields'], kbnArchives: ['x-pack/performance/kbn_archives/ecommerce_tsvb_gauge_only_dashboard'], -}) - - .step('Go to Dashboards Page', async ({ page, kbnUrl, kibanaPage }) => { - await page.goto(kbnUrl.get(`/app/dashboards`)); - await kibanaPage.waitForListViewTable(); - }) - - .step('Go to Ecommerce Dashboard with TSVB Gauge only', async ({ page, kibanaPage }) => { - await page.click(subj('dashboardListingTitleLink-[eCommerce]-TSVB-Gauge-Only-Dashboard')); - await kibanaPage.waitForVisualizations({ count: 1 }); - }); + dashboardName: 'Ecommerce Dashboard with TSVB Gauge only', + dashboardLinkSubj: 'dashboardListingTitleLink-[eCommerce]-TSVB-Gauge-Only-Dashboard', + visualizationCount: 1, +}); diff --git a/x-pack/performance/journeys_e2e/flight_dashboard.ts b/x-pack/performance/journeys_e2e/flight_dashboard.ts index 76818f5e37343..28247e9d8c51e 100644 --- a/x-pack/performance/journeys_e2e/flight_dashboard.ts +++ b/x-pack/performance/journeys_e2e/flight_dashboard.ts @@ -5,20 +5,12 @@ * 2.0. */ -import { Journey } from '@kbn/journeys'; -import { subj } from '@kbn/test-subj-selector'; +import { createDashboardJourney } from './utils/dashboard_journey'; -export const journey = new Journey({ +export const journey = createDashboardJourney({ esArchives: ['x-pack/performance/es_archives/sample_data_flights_many_fields'], kbnArchives: ['x-pack/performance/kbn_archives/flights_no_map_dashboard'], -}) - - .step('Go to Dashboards Page', async ({ page, kbnUrl, kibanaPage }) => { - await page.goto(kbnUrl.get(`/app/dashboards`)); - await kibanaPage.waitForListViewTable(); - }) - - .step('Go to Flights Dashboard', async ({ page, kibanaPage }) => { - await page.click(subj('dashboardListingTitleLink-[Flights]-Global-Flight-Dashboard')); - await kibanaPage.waitForVisualizations({ count: 14 }); - }); + dashboardName: 'Flights Dashboard', + dashboardLinkSubj: 'dashboardListingTitleLink-[Flights]-Global-Flight-Dashboard', + visualizationCount: 14, +}); diff --git a/x-pack/performance/journeys_e2e/utils/dashboard_journey.ts b/x-pack/performance/journeys_e2e/utils/dashboard_journey.ts new file mode 100644 index 0000000000000..3f8d33084ff18 --- /dev/null +++ b/x-pack/performance/journeys_e2e/utils/dashboard_journey.ts @@ -0,0 +1,70 @@ +/* + * 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 type { KibanaServer } from '@kbn/ftr-common-functional-services'; +import { Journey } from '@kbn/journeys'; +import type { KibanaPage } from '@kbn/journeys/services/page/kibana_page'; +import { subj } from '@kbn/test-subj-selector'; +import type { Page } from 'playwright'; + +interface DashboardJourneyConfig { + esArchives: string[]; + kbnArchives: string[]; + dashboardName: string; + dashboardLinkSubj: string; + setup?: (kibanaServer: KibanaServer) => Promise; + visualizationCount?: number; + loadCompleteAwaiter?: (page: Page, kibanaPage: KibanaPage) => Promise; +} + +export function createDashboardJourney(config: DashboardJourneyConfig): Journey<{}> { + const waitForDashboardLoad = async (page: Page, kibanaPage: KibanaPage) => { + if (config.visualizationCount) { + await kibanaPage.waitForVisualizations({ count: config.visualizationCount }); + } else if (config.loadCompleteAwaiter) { + await config.loadCompleteAwaiter(page, kibanaPage); + } else { + throw new Error( + 'Either visualizationCount or loadCompleteAwaiter must be provided in the config' + ); + } + }; + + const journey = new Journey({ + esArchives: config.esArchives, + kbnArchives: config.kbnArchives, + }); + + if (config.setup) { + journey.step('Setup', async ({ kibanaServer }) => { + await config.setup!(kibanaServer); + }); + } + + return journey + .step('Go to Dashboards Page', async ({ page, kbnUrl, kibanaPage }) => { + await page.goto(kbnUrl.get(`/app/dashboards`)); + await kibanaPage.waitForListViewTable(); + }) + .step(`Go to ${config.dashboardName}`, async ({ page, kibanaPage }) => { + await page.click(subj(config.dashboardLinkSubj)); + await waitForDashboardLoad(page, kibanaPage); + }) + .step('Return to listing page', async ({ page, kibanaPage }) => { + await kibanaPage.backToDashboardListing(); + await kibanaPage.waitForListViewTable(); + }) + .step(`Return to dashboard`, async ({ page, kibanaPage }) => { + await page.click(subj(config.dashboardLinkSubj)); + await waitForDashboardLoad(page, kibanaPage); + }) + .step('Refresh dashboard', async ({ page, kibanaPage }) => { + await page.waitForTimeout(1000); // be sure things are stable + await page.click(subj('querySubmitButton')); + await waitForDashboardLoad(page, kibanaPage); + }); +} diff --git a/x-pack/performance/journeys_e2e/web_logs_dashboard.ts b/x-pack/performance/journeys_e2e/web_logs_dashboard.ts index 61d064f0bb4ea..f47d48933d750 100644 --- a/x-pack/performance/journeys_e2e/web_logs_dashboard.ts +++ b/x-pack/performance/journeys_e2e/web_logs_dashboard.ts @@ -5,20 +5,12 @@ * 2.0. */ -import { Journey } from '@kbn/journeys'; -import { subj } from '@kbn/test-subj-selector'; +import { createDashboardJourney } from './utils/dashboard_journey'; -export const journey = new Journey({ +export const journey = createDashboardJourney({ esArchives: ['x-pack/performance/es_archives/sample_data_logs_many_fields'], kbnArchives: ['x-pack/performance/kbn_archives/logs_no_map_dashboard'], -}) - - .step('Go to Dashboards Page', async ({ page, kbnUrl, kibanaPage }) => { - await page.goto(kbnUrl.get(`/app/dashboards`)); - await kibanaPage.waitForListViewTable(); - }) - - .step('Go to Web Logs Dashboard', async ({ page, kibanaPage }) => { - await page.click(subj('dashboardListingTitleLink-[Logs]-Web-Traffic')); - await kibanaPage.waitForVisualizations({ count: 11 }); - }); + dashboardName: 'Web Logs Dashboard', + dashboardLinkSubj: 'dashboardListingTitleLink-[Logs]-Web-Traffic', + visualizationCount: 11, +}); diff --git a/x-pack/performance/journeys_e2e/web_logs_dashboard_esql.ts b/x-pack/performance/journeys_e2e/web_logs_dashboard_esql.ts index 2ee7365500b77..dc6ad51e14164 100644 --- a/x-pack/performance/journeys_e2e/web_logs_dashboard_esql.ts +++ b/x-pack/performance/journeys_e2e/web_logs_dashboard_esql.ts @@ -5,20 +5,12 @@ * 2.0. */ -import { Journey } from '@kbn/journeys'; -import { subj } from '@kbn/test-subj-selector'; +import { createDashboardJourney } from './utils/dashboard_journey'; -export const journey = new Journey({ +export const journey = createDashboardJourney({ esArchives: ['x-pack/performance/es_archives/sample_data_logs_many_fields'], kbnArchives: ['x-pack/performance/kbn_archives/logs_no_map_dashboard_esql'], -}) - - .step('Go to Dashboards Page', async ({ page, kbnUrl, kibanaPage }) => { - await page.goto(kbnUrl.get(`/app/dashboards`)); - await kibanaPage.waitForListViewTable(); - }) - - .step('Go to Web Logs Dashboard', async ({ page, kibanaPage }) => { - await page.click(subj('dashboardListingTitleLink-Logs-dashboard-with-ES|QL')); - await kibanaPage.waitForVisualizations({ count: 11 }); - }); + dashboardName: 'Web Logs Dashboard', + dashboardLinkSubj: 'dashboardListingTitleLink-Logs-dashboard-with-ES|QL', + visualizationCount: 11, +}); diff --git a/x-pack/performance/journeys_e2e/web_logs_dashboard_esql_long_running.ts b/x-pack/performance/journeys_e2e/web_logs_dashboard_esql_long_running.ts index 7620eb25cf2db..11269b3a18001 100644 --- a/x-pack/performance/journeys_e2e/web_logs_dashboard_esql_long_running.ts +++ b/x-pack/performance/journeys_e2e/web_logs_dashboard_esql_long_running.ts @@ -5,20 +5,12 @@ * 2.0. */ -import { Journey } from '@kbn/journeys'; -import { subj } from '@kbn/test-subj-selector'; +import { createDashboardJourney } from './utils/dashboard_journey'; -export const journey = new Journey({ +export const journey = createDashboardJourney({ esArchives: ['x-pack/performance/es_archives/sample_data_logs_many_fields'], kbnArchives: ['x-pack/performance/kbn_archives/logs_no_map_dashboard_esql_long_running'], -}) - - .step('Go to Dashboards Page', async ({ page, kbnUrl, kibanaPage }) => { - await page.goto(kbnUrl.get(`/app/dashboards`)); - await kibanaPage.waitForListViewTable(); - }) - - .step('Go to Web Logs Dashboard', async ({ page, kibanaPage }) => { - await page.click(subj('dashboardListingTitleLink-Logs-dashboard-with-ES|QL')); - await kibanaPage.waitForVisualizations({ count: 11 }); - }); + dashboardName: 'Web Logs Dashboard', + dashboardLinkSubj: 'dashboardListingTitleLink-Logs-dashboard-with-ES|QL', + visualizationCount: 11, +}); diff --git a/x-pack/performance/journeys_e2e/web_logs_dashboard_long_running.ts b/x-pack/performance/journeys_e2e/web_logs_dashboard_long_running.ts index d59c00e1e25fd..8f8691c078474 100644 --- a/x-pack/performance/journeys_e2e/web_logs_dashboard_long_running.ts +++ b/x-pack/performance/journeys_e2e/web_logs_dashboard_long_running.ts @@ -5,20 +5,12 @@ * 2.0. */ -import { Journey } from '@kbn/journeys'; -import { subj } from '@kbn/test-subj-selector'; +import { createDashboardJourney } from './utils/dashboard_journey'; -export const journey = new Journey({ +export const journey = createDashboardJourney({ esArchives: ['x-pack/performance/es_archives/sample_data_logs_many_fields'], kbnArchives: ['x-pack/performance/kbn_archives/logs_no_map_dashboard_long_running'], -}) - - .step('Go to Dashboards Page', async ({ page, kbnUrl, kibanaPage }) => { - await page.goto(kbnUrl.get(`/app/dashboards`)); - await kibanaPage.waitForListViewTable(); - }) - - .step('Go to Web Logs Dashboard', async ({ page, kibanaPage }) => { - await page.click(subj('dashboardListingTitleLink-[Logs]-Web-Traffic')); - await kibanaPage.waitForVisualizations({ count: 11 }); - }); + dashboardName: 'Web Logs Dashboard', + dashboardLinkSubj: 'dashboardListingTitleLink-[Logs]-Web-Traffic', + visualizationCount: 11, +}); From fe4d0c93097c02e57c7510ff5f3b398a2100102c Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 29 Jan 2026 16:49:52 +0000 Subject: [PATCH 2/3] Changes from node scripts/lint_ts_projects --fix --- x-pack/performance/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/performance/tsconfig.json b/x-pack/performance/tsconfig.json index 6b172b25edd93..69cdd3352a107 100644 --- a/x-pack/performance/tsconfig.json +++ b/x-pack/performance/tsconfig.json @@ -22,6 +22,7 @@ "@kbn/expect", "@kbn/dev-utils", "@kbn/synthtrace-client", - "@kbn/test-suites-src" + "@kbn/test-suites-src", + "@kbn/ftr-common-functional-services" ] } From 84e420d2e3ae49313816e761f40b0481211c586c Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 29 Jan 2026 17:00:43 +0000 Subject: [PATCH 3/3] Changes from node scripts/regenerate_moon_projects.js --update --- x-pack/performance/moon.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/performance/moon.yml b/x-pack/performance/moon.yml index 41ca31cf493c3..e0709b924df7e 100644 --- a/x-pack/performance/moon.yml +++ b/x-pack/performance/moon.yml @@ -26,6 +26,7 @@ dependsOn: - '@kbn/dev-utils' - '@kbn/synthtrace-client' - '@kbn/test-suites-src' + - '@kbn/ftr-common-functional-services' tags: - test-helper - package