mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Performance] Add dashboard creation to journey (#148818)
## Summary Add a new dashboard. Blocked by https://github.com/elastic/kibana/pull/148768 ### Checklist Delete any items that are not applicable to this PR. - ~~[ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)~~ - ~~[ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials~~ - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - ~~[ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/))~~ - ~~[ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))~~ - ~~[ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~~ - ~~[ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))~~ - ~~[ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers)~~ ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
This commit is contained in:
parent
b57b40ebad
commit
dc80574a89
3 changed files with 26 additions and 1 deletions
|
@ -44,6 +44,7 @@ export function createDashboardListingFilterUrl(filter: string | undefined) {
|
|||
export const DASHBOARD_LOADED_EVENT = 'dashboard_loaded';
|
||||
export const SAVED_OBJECT_LOADED_TIME = 'saved_object_loaded_time';
|
||||
export const SAVED_OBJECT_DELETE_TIME = 'saved_object_delete_time';
|
||||
export const SAVED_OBJECT_POST_TIME = 'saved_object_post_time';
|
||||
export const DASHBOARD_UI_METRIC_ID = 'dashboard';
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
|
|
@ -10,6 +10,8 @@ import React from 'react';
|
|||
import { batch } from 'react-redux';
|
||||
import { showSaveModal } from '@kbn/saved-objects-plugin/public';
|
||||
|
||||
import { reportPerformanceMetricEvent } from '@kbn/ebt-tools';
|
||||
import { DASHBOARD_SAVED_OBJECT_TYPE, SAVED_OBJECT_POST_TIME } from '../../../dashboard_constants';
|
||||
import { DashboardSaveOptions, DashboardStateFromSaveModal } from '../../types';
|
||||
import { DashboardSaveModal } from './overlays/save_modal';
|
||||
import { DashboardContainer } from '../dashboard_container';
|
||||
|
@ -84,11 +86,20 @@ export function runSaveAs(this: DashboardContainer) {
|
|||
...currentState,
|
||||
...stateFromSaveModal,
|
||||
};
|
||||
const beforeAddTime = window.performance.now();
|
||||
const saveResult = await saveDashboardStateToSavedObject({
|
||||
currentState: stateToSave,
|
||||
saveOptions,
|
||||
lastSavedId,
|
||||
});
|
||||
const addDuration = window.performance.now() - beforeAddTime;
|
||||
reportPerformanceMetricEvent(pluginServices.getServices().analytics, {
|
||||
eventName: SAVED_OBJECT_POST_TIME,
|
||||
duration: addDuration,
|
||||
meta: {
|
||||
saved_object_type: DASHBOARD_SAVED_OBJECT_TYPE,
|
||||
},
|
||||
});
|
||||
|
||||
stateFromSaveModal.lastSavedId = saveResult.id;
|
||||
if (saveResult.id) {
|
||||
|
|
|
@ -18,7 +18,7 @@ export const journey = new Journey({
|
|||
await page.goto(kbnUrl.get(`/app/dashboards`));
|
||||
await page.waitForSelector(`[data-test-subj="table-is-ready"]`);
|
||||
})
|
||||
.step('Search dashboards page', async ({ page, inputDelays }) => {
|
||||
.step('Search dashboards', async ({ page, inputDelays }) => {
|
||||
await page.type('[data-test-subj="tableListSearchBox"]', 'Web', {
|
||||
delay: inputDelays.TYPING,
|
||||
});
|
||||
|
@ -29,4 +29,17 @@ export const journey = new Journey({
|
|||
await page.click('[data-test-subj="deleteSelectedItems"]');
|
||||
await page.click('[data-test-subj="confirmModalConfirmButton"]');
|
||||
await page.waitForSelector(`[data-test-subj="table-is-ready"]`);
|
||||
})
|
||||
.step('Add dashboard', async ({ page, inputDelays }) => {
|
||||
await page.click('[data-test-subj="newItemButton"]');
|
||||
await page.click('[data-test-subj="dashboardSaveMenuItem"]');
|
||||
await page.type('[data-test-subj="savedObjectTitle"]', 'foobar dashboard', {
|
||||
delay: inputDelays.TYPING,
|
||||
});
|
||||
await page.click('[data-test-subj="confirmSaveSavedObjectButton"]');
|
||||
await page.locator('[data-test-subj="saveDashboardSuccess"]');
|
||||
})
|
||||
.step('Return to dashboard list', async ({ page, inputDelays }) => {
|
||||
await page.click('[data-test-subj="breadcrumb dashboardListingBreadcrumb first"]');
|
||||
await page.waitForSelector(`[data-test-subj="table-is-ready"]`);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue