Files
grafana/e2e-playwright/various-suite/visualization-suggestions.spec.ts
Paul Marbach 7626508842 Table: Update e2e tests to support tableNextGen (#108184)
* Table: Force tableNextGen to be true for Playwright and false for Cypress

* RDG query for body text contains the headers too

* add some simple tests for row height

* dial in the row height test a little more

* more updates

* filters, pagination

* try this on CI

* more updates to the tests

* more tests

* wait for some sort stuff to flush

* replace class selectors for rdg

* target the click to the anchor in the header
2025-07-18 12:27:04 -04:00

52 lines
1.5 KiB
TypeScript

import { test, expect } from '@grafana/plugin-e2e';
test.use({
featureToggles: {
tableNextGen: true,
},
});
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.RadioButton.container)
.filter({ hasText: 'Suggestions' })
.click();
// Verify we see suggestions
const lineChartCard = panelEditPage.getByGrafanaSelector(
selectors.components.VisualizationPreview.card('Line chart')
);
await expect(lineChartCard).toBeVisible();
// Verify search works
const searchInput = page.getByPlaceholder('Search for...');
await searchInput.fill('Table');
// Should no longer see line chart
await expect(lineChartCard).toBeHidden();
// 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();
});
}
);