kibana/test/accessibility/apps/dashboard.ts
Ola Pawlus b4032c10e1
[8.18] Fix: success message and scroll after adding panel from library (#220122) (#220777)
# Backport

This will backport the following commits from `main` to `8.18`:
- [Fix: success message and scroll after adding panel from library
(#220122)](https://github.com/elastic/kibana/pull/220122)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Ola
Pawlus","email":"98127445+olapawlus@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-05-09T17:24:49Z","message":"Fix:
success message and scroll after adding panel from library
(#220122)\n\nInitially there was no success message for any type in the
library and\nthere was no scrolling to added panel.\n\nThis change sets
displaySuccessMessage to true for each plugin\nregistered in the Add
from Library flyout.\n\nIt ensures that:\n- users see a success toast
after adding a panel,\n- the newly added panel is automatically scrolled
into view.\n\nCloses: #188775\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e7e8d2f13b44ae78b33ada4a3904b17066c6fd37","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Feature:Dashboard","Feature:Embedding","regression","release_note:fix","Team:Presentation","loe:small","impact:high","backport:version","v9.1.0","v8.19.0","v8.18.2","v9.0.2"],"title":"Fix:
success message and scroll after adding panel from
library","number":220122,"url":"https://github.com/elastic/kibana/pull/220122","mergeCommit":{"message":"Fix:
success message and scroll after adding panel from library
(#220122)\n\nInitially there was no success message for any type in the
library and\nthere was no scrolling to added panel.\n\nThis change sets
displaySuccessMessage to true for each plugin\nregistered in the Add
from Library flyout.\n\nIt ensures that:\n- users see a success toast
after adding a panel,\n- the newly added panel is automatically scrolled
into view.\n\nCloses: #188775\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e7e8d2f13b44ae78b33ada4a3904b17066c6fd37"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/220122","number":220122,"mergeCommit":{"message":"Fix:
success message and scroll after adding panel from library
(#220122)\n\nInitially there was no success message for any type in the
library and\nthere was no scrolling to added panel.\n\nThis change sets
displaySuccessMessage to true for each plugin\nregistered in the Add
from Library flyout.\n\nIt ensures that:\n- users see a success toast
after adding a panel,\n- the newly added panel is automatically scrolled
into view.\n\nCloses: #188775\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e7e8d2f13b44ae78b33ada4a3904b17066c6fd37"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/220703","number":220703,"state":"MERGED","mergeCommit":{"sha":"7501611e3277d378ea00e1731b39be0ebeb7769b","message":"[8.19]
Fix: success message and scroll after adding panel from library
(#220122) (#220703)\n\n# Backport\n\nThis will backport the following
commits from `main` to `8.19`:\n- [Fix: success message and scroll after
adding panel from
library\n(#220122)](https://github.com/elastic/kibana/pull/220122)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Ola Pawlus
<98127445+olapawlus@users.noreply.github.com>"}},{"branch":"8.18","label":"v8.18.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-05-14 08:55:53 +02:00

152 lines
5.1 KiB
TypeScript

/*
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { FtrProviderContext } from '../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const { common, dashboard } = getPageObjects(['common', 'dashboard']);
const a11y = getService('a11y');
const dashboardAddPanel = getService('dashboardAddPanel');
const dashboardSettings = getService('dashboardSettings');
const testSubjects = getService('testSubjects');
const listingTable = getService('listingTable');
// https://github.com/elastic/kibana/issues/220515
describe.skip('Dashboard', () => {
const dashboardName = 'Dashboard Listing A11y';
const clonedDashboardName = 'Dashboard Listing A11y (1)';
// https://github.com/elastic/kibana/issues/220515
it.skip('navigate to dashboard app', async () => {
await common.navigateToApp('dashboard');
await a11y.testAppSnapshot();
});
it('create dashboard button', async () => {
await dashboard.clickNewDashboard();
await a11y.testAppSnapshot();
});
it('save empty dashboard', async () => {
await dashboard.saveDashboard(dashboardName);
await a11y.testAppSnapshot();
});
it('Open Edit mode', async () => {
await dashboard.switchToEditMode();
await a11y.testAppSnapshot();
});
it('Open add panel', async () => {
await dashboardAddPanel.clickOpenAddPanel();
await a11y.testAppSnapshot();
});
it('add a visualization', async () => {
await testSubjects.setValue('savedObjectFinderSearchInput', '[Flights]');
await testSubjects.click('savedObjectTitle[Flights]-Departures-Count-Map');
await a11y.testAppSnapshot();
});
it('add a saved search', async () => {
await dashboardAddPanel.addSavedSearch('[Flights] Flight Log');
await a11y.testAppSnapshot();
});
it('save the dashboard', async () => {
await dashboard.saveDashboard(dashboardName, { saveAsNew: false });
await a11y.testAppSnapshot();
});
it('Open Edit mode again', async () => {
await dashboard.switchToEditMode();
await a11y.testAppSnapshot();
});
it('open settings flyout', async () => {
await dashboard.openSettingsFlyout();
await a11y.testAppSnapshot();
});
it('Should be able to hide panel titles', async () => {
await dashboardSettings.toggleShowPanelTitles(false);
await a11y.testAppSnapshot();
});
it('Should be able display panels without margins', async () => {
await dashboardSettings.toggleUseMarginsBetweenPanels(true);
await a11y.testAppSnapshot();
});
it('close settings flyout', async () => {
await dashboardSettings.clickCancelButton();
await a11y.testAppSnapshot();
});
it('Open add panel again', async () => {
await dashboardAddPanel.clickOpenAddPanel();
await a11y.testAppSnapshot();
});
it('Add one more saved object to cancel it', async () => {
await testSubjects.setValue('savedObjectFinderSearchInput', '[Flights]');
await testSubjects.click(
'savedObjectTitle[Flights]-Airport-Connections-(Hover-Over-Airport)'
);
await a11y.testAppSnapshot();
});
it('Close add panel', async () => {
await dashboardAddPanel.closeAddPanel();
await a11y.testAppSnapshot();
});
it('Exit out of edit mode', async () => {
await dashboard.clickCancelOutOfEditMode(false);
await a11y.testAppSnapshot();
});
it('Discard changes', async () => {
await common.clickConfirmOnModal();
await dashboard.getIsInViewMode();
await a11y.testAppSnapshot();
});
// https://github.com/elastic/kibana/issues/153597
it.skip('Test full screen', async () => {
await dashboard.clickFullScreenMode();
await a11y.testAppSnapshot();
});
// https://github.com/elastic/kibana/issues/153597
it.skip('Exit out of full screen mode', async () => {
await dashboard.exitFullScreenMode();
await a11y.testAppSnapshot();
});
it('Make a clone of the dashboard', async () => {
await dashboard.duplicateDashboard();
await a11y.testAppSnapshot();
});
it('Dashboard listing table', async () => {
await dashboard.gotoDashboardLandingPage();
await a11y.testAppSnapshot();
});
it('Delete a11y clone dashboard', async () => {
await listingTable.searchForItemWithName(clonedDashboardName);
await listingTable.checkListingSelectAllCheckbox();
await listingTable.clickDeleteSelected();
await a11y.testAppSnapshot();
await common.clickConfirmOnModal();
await listingTable.isShowingEmptyPromptCreateNewButton();
});
});
}