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 ab425ee96b326..72da640c5cf6d 100644 --- a/x-pack/performance/journeys_e2e/data_stress_test_lens.ts +++ b/x-pack/performance/journeys_e2e/data_stress_test_lens.ts @@ -5,11 +5,15 @@ * 2.0. */ -import { createDashboardJourney } from '../utils/dashboard_journey'; +import { Journey } from '@kbn/journeys'; +import { setupDashboardJourney } from '../utils/dashboard_journey'; -export const journey = createDashboardJourney({ - esArchives: ['src/platform/test/functional/fixtures/es_archiver/stress_test'], - kbnArchives: ['src/platform/test/functional/fixtures/kbn_archiver/stress_test'], +export const journey = setupDashboardJourney({ + // call the journey constructor in this file so the name is set correctly + journey: new Journey({ + esArchives: ['src/platform/test/functional/fixtures/es_archiver/stress_test'], + kbnArchives: ['src/platform/test/functional/fixtures/kbn_archiver/stress_test'], + }), dashboardName: 'Stress Test Dashboard', dashboardLinkSubj: 'dashboardListingTitleLink-Stresstest', visualizationCount: 1, diff --git a/x-pack/performance/journeys_e2e/data_stress_test_lens_esql.ts b/x-pack/performance/journeys_e2e/data_stress_test_lens_esql.ts index 69c1ae044bfb8..8b4f2e7405383 100644 --- a/x-pack/performance/journeys_e2e/data_stress_test_lens_esql.ts +++ b/x-pack/performance/journeys_e2e/data_stress_test_lens_esql.ts @@ -5,11 +5,15 @@ * 2.0. */ -import { createDashboardJourney } from '../utils/dashboard_journey'; +import { Journey } from '@kbn/journeys'; +import { setupDashboardJourney } from '../utils/dashboard_journey'; -export const journey = createDashboardJourney({ - esArchives: ['src/platform/test/functional/fixtures/es_archiver/stress_test'], - kbnArchives: ['src/platform/test/functional/fixtures/kbn_archiver/stress_test_esql'], +export const journey = setupDashboardJourney({ + // call the journey constructor in this file so the name is set correctly + journey: new Journey({ + esArchives: ['src/platform/test/functional/fixtures/es_archiver/stress_test'], + kbnArchives: ['src/platform/test/functional/fixtures/kbn_archiver/stress_test_esql'], + }), dashboardName: 'Stress Test Dashboard', dashboardLinkSubj: 'dashboardListingTitleLink-Stresstest-(ES|QL)', visualizationCount: 1, 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 abe6de5bacb36..ee886b706cf1d 100644 --- a/x-pack/performance/journeys_e2e/ecommerce_dashboard_map_only.ts +++ b/x-pack/performance/journeys_e2e/ecommerce_dashboard_map_only.ts @@ -5,11 +5,15 @@ * 2.0. */ -import { createDashboardJourney } from '../utils/dashboard_journey'; +import { Journey } from '@kbn/journeys'; +import { setupDashboardJourney } from '../utils/dashboard_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'], +export const journey = setupDashboardJourney({ + // call the journey constructor in this file so the name is set correctly + journey: new Journey({ + esArchives: ['x-pack/performance/es_archives/sample_data_ecommerce_many_fields'], + kbnArchives: ['x-pack/performance/kbn_archives/ecommerce_map_only_dashboard'], + }), dashboardName: 'Ecommerce Dashboard with Map only', dashboardLinkSubj: 'dashboardListingTitleLink-[eCommerce]-Map-Only', loadCompleteAwaiter: async (page, kibanaPage) => { 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 807d58f3b1376..c17abc139ef35 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,11 +5,15 @@ * 2.0. */ -import { createDashboardJourney } from '../utils/dashboard_journey'; +import { Journey } from '@kbn/journeys'; +import { setupDashboardJourney } from '../utils/dashboard_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'], +export const journey = setupDashboardJourney({ + // call the journey constructor in this file so the name is set correctly + journey: new Journey({ + esArchives: ['x-pack/performance/es_archives/sample_data_ecommerce_many_fields'], + kbnArchives: ['x-pack/performance/kbn_archives/ecommerce_saved_search_only_dashboard'], + }), 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 453c7cf66f869..5a3ce3070fb98 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,11 +5,15 @@ * 2.0. */ -import { createDashboardJourney } from '../utils/dashboard_journey'; +import { Journey } from '@kbn/journeys'; +import { setupDashboardJourney } from '../utils/dashboard_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'], +export const journey = setupDashboardJourney({ + // call the journey constructor in this file so the name is set correctly + journey: new Journey({ + esArchives: ['x-pack/performance/es_archives/sample_data_ecommerce_many_fields'], + kbnArchives: ['x-pack/performance/kbn_archives/ecommerce_tsvb_gauge_only_dashboard'], + }), 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 a282d64e90c49..eb079ba271b49 100644 --- a/x-pack/performance/journeys_e2e/flight_dashboard.ts +++ b/x-pack/performance/journeys_e2e/flight_dashboard.ts @@ -5,11 +5,15 @@ * 2.0. */ -import { createDashboardJourney } from '../utils/dashboard_journey'; +import { Journey } from '@kbn/journeys'; +import { setupDashboardJourney } from '../utils/dashboard_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'], +export const journey = setupDashboardJourney({ + // call the journey constructor in this file so the name is set correctly + journey: new Journey({ + esArchives: ['x-pack/performance/es_archives/sample_data_flights_many_fields'], + kbnArchives: ['x-pack/performance/kbn_archives/flights_no_map_dashboard'], + }), dashboardName: 'Flights Dashboard', dashboardLinkSubj: 'dashboardListingTitleLink-[Flights]-Global-Flight-Dashboard', visualizationCount: 14, diff --git a/x-pack/performance/journeys_e2e/web_logs_dashboard.ts b/x-pack/performance/journeys_e2e/web_logs_dashboard.ts index d84a66db46a50..b109a82dd5ad0 100644 --- a/x-pack/performance/journeys_e2e/web_logs_dashboard.ts +++ b/x-pack/performance/journeys_e2e/web_logs_dashboard.ts @@ -5,11 +5,15 @@ * 2.0. */ -import { createDashboardJourney } from '../utils/dashboard_journey'; +import { Journey } from '@kbn/journeys'; +import { setupDashboardJourney } from '../utils/dashboard_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'], +export const journey = setupDashboardJourney({ + // call the journey constructor in this file so the name is set correctly + journey: new Journey({ + esArchives: ['x-pack/performance/es_archives/sample_data_logs_many_fields'], + kbnArchives: ['x-pack/performance/kbn_archives/logs_no_map_dashboard'], + }), 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 7794b6e1f7db4..08296867bc470 100644 --- a/x-pack/performance/journeys_e2e/web_logs_dashboard_esql.ts +++ b/x-pack/performance/journeys_e2e/web_logs_dashboard_esql.ts @@ -5,11 +5,15 @@ * 2.0. */ -import { createDashboardJourney } from '../utils/dashboard_journey'; +import { Journey } from '@kbn/journeys'; +import { setupDashboardJourney } from '../utils/dashboard_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'], +export const journey = setupDashboardJourney({ + // call the journey constructor in this file so the name is set correctly + journey: new Journey({ + esArchives: ['x-pack/performance/es_archives/sample_data_logs_many_fields'], + kbnArchives: ['x-pack/performance/kbn_archives/logs_no_map_dashboard_esql'], + }), 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 d67dd7576121b..478f39200d61b 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,11 +5,15 @@ * 2.0. */ -import { createDashboardJourney } from '../utils/dashboard_journey'; +import { Journey } from '@kbn/journeys'; +import { setupDashboardJourney } from '../utils/dashboard_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'], +export const journey = setupDashboardJourney({ + // call the journey constructor in this file so the name is set correctly + journey: new Journey({ + esArchives: ['x-pack/performance/es_archives/sample_data_logs_many_fields'], + kbnArchives: ['x-pack/performance/kbn_archives/logs_no_map_dashboard_esql_long_running'], + }), 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 b97e69e9ce140..44fb7b616fffc 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,11 +5,15 @@ * 2.0. */ -import { createDashboardJourney } from '../utils/dashboard_journey'; +import { Journey } from '@kbn/journeys'; +import { setupDashboardJourney } from '../utils/dashboard_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'], +export const journey = setupDashboardJourney({ + // call the journey constructor in this file so the name is set correctly + journey: new Journey({ + esArchives: ['x-pack/performance/es_archives/sample_data_logs_many_fields'], + kbnArchives: ['x-pack/performance/kbn_archives/logs_no_map_dashboard_long_running'], + }), dashboardName: 'Web Logs Dashboard', dashboardLinkSubj: 'dashboardListingTitleLink-[Logs]-Web-Traffic', visualizationCount: 11, diff --git a/x-pack/performance/utils/dashboard_journey.ts b/x-pack/performance/utils/dashboard_journey.ts index 3f8d33084ff18..bf6a0abda94f2 100644 --- a/x-pack/performance/utils/dashboard_journey.ts +++ b/x-pack/performance/utils/dashboard_journey.ts @@ -6,14 +6,13 @@ */ import type { KibanaServer } from '@kbn/ftr-common-functional-services'; -import { Journey } from '@kbn/journeys'; +import type { 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[]; + journey: Journey<{}>; dashboardName: string; dashboardLinkSubj: string; setup?: (kibanaServer: KibanaServer) => Promise; @@ -21,7 +20,7 @@ interface DashboardJourneyConfig { loadCompleteAwaiter?: (page: Page, kibanaPage: KibanaPage) => Promise; } -export function createDashboardJourney(config: DashboardJourneyConfig): Journey<{}> { +export function setupDashboardJourney(config: DashboardJourneyConfig): Journey<{}> { const waitForDashboardLoad = async (page: Page, kibanaPage: KibanaPage) => { if (config.visualizationCount) { await kibanaPage.waitForVisualizations({ count: config.visualizationCount }); @@ -34,18 +33,13 @@ export function createDashboardJourney(config: DashboardJourneyConfig): Journey< } }; - const journey = new Journey({ - esArchives: config.esArchives, - kbnArchives: config.kbnArchives, - }); - if (config.setup) { - journey.step('Setup', async ({ kibanaServer }) => { + config.journey.step('Setup', async ({ kibanaServer }) => { await config.setup!(kibanaServer); }); } - return journey + return config.journey .step('Go to Dashboards Page', async ({ page, kbnUrl, kibanaPage }) => { await page.goto(kbnUrl.get(`/app/dashboards`)); await kibanaPage.waitForListViewTable();