Files
grafana/e2e-playwright/various-suite/visualization-suggestions.spec.ts
T
Adela Almasan ede756f5a8 Suggestions: Introduce V2 right sidebar (#114274)
* newVizSuggestions feature toggle

* panel empty state

* add data check

* select first suggestion

* update text

* PanelEmptyState component

* add test

* ?

* remove fake translation

* Visualizations -> All visualizations

* updates

* move empty state to UnconfiguredPanel

* default tab to Suggestions; new tabs and content

* select first suggestion; apply button; removed search functionaility from suggestions

* extract hasData

* refactor

* cleanup

* fix default selection

* translation

* hasData test

* update e2e

* fix width of suggestions tabs

* make sure we only show a max of two columns

* useMeasure with a static gridTemplateColumns def

* Suggestions: hashes on suggestions, update logic to select first suggestion

* reorganize comments a little bit

* fix types

* add tests for hashes

---------

Co-authored-by: Paul Marbach <paul.marbach@grafana.com>
2025-11-25 00:59:25 +00:00

38 lines
1.3 KiB
TypeScript

import { test, expect } from '@grafana/plugin-e2e';
test.describe(
'Visualization suggestions',
{
tag: ['@various'],
},
() => {
test('Should be shown and clickable', async ({ page, selectors, gotoPanelEditPage }) => {
// Open dashboard with edit panel
const panelEditPage = await gotoPanelEditPage({
dashboard: {
uid: 'aBXrJ0R7z',
},
id: '9',
});
// Try visualization suggestions
await panelEditPage.getByGrafanaSelector(selectors.components.PanelEditor.toggleVizPicker).click();
await panelEditPage.getByGrafanaSelector(selectors.components.Tab.title('Suggestions')).click();
// Verify we see suggestions
const lineChartCard = panelEditPage.getByGrafanaSelector(
selectors.components.VisualizationPreview.card('Line chart')
);
await expect(lineChartCard).toBeVisible();
// TODO: in this part of the test, we will change the query and the transforms and observe suggestions being updated.
// Select a visualization
await panelEditPage.getByGrafanaSelector(selectors.components.VisualizationPreview.card('Table')).click();
// Verify table header is visible
await expect(page.getByRole('grid').getByRole('row').first()).toBeVisible();
});
}
);