Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions x-pack/performance/journeys_e2e/data_stress_test_lens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
},
});
20 changes: 7 additions & 13 deletions x-pack/performance/journeys_e2e/ecommerce_dashboard_map_only.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"]'
);
});
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
20 changes: 6 additions & 14 deletions x-pack/performance/journeys_e2e/flight_dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
70 changes: 70 additions & 0 deletions x-pack/performance/journeys_e2e/utils/dashboard_journey.ts
Original file line number Diff line number Diff line change
@@ -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<void>;
visualizationCount?: number;
loadCompleteAwaiter?: (page: Page, kibanaPage: KibanaPage) => Promise<void>;
}

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);
});
}
20 changes: 6 additions & 14 deletions x-pack/performance/journeys_e2e/web_logs_dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
20 changes: 6 additions & 14 deletions x-pack/performance/journeys_e2e/web_logs_dashboard_esql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
1 change: 1 addition & 0 deletions x-pack/performance/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependsOn:
- '@kbn/dev-utils'
- '@kbn/synthtrace-client'
- '@kbn/test-suites-src'
- '@kbn/ftr-common-functional-services'
tags:
- test-helper
- package
Expand Down
3 changes: 2 additions & 1 deletion x-pack/performance/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
Loading