The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/e2e-playwright/smoke-tests-suite/panels-smokescreen.spec.ts

49 lines
1.8 KiB

import { test, expect } from '@grafana/plugin-e2e';
import { GrafanaBootConfig } from '@grafana/runtime';
test.describe(
'Panels smokescreen',
{
tag: ['@smoke'],
},
() => {
test('Tests each panel type in the panel edit view to ensure no crash', async ({
gotoDashboardPage,
selectors,
page,
}) => {
// this test can absolutely take longer than the default 30s timeout
test.setTimeout(60000);
// Create new dashboard
const dashboardPage = await gotoDashboardPage({});
// Add new panel
await dashboardPage.addPanel();
// Get panel types from window object
const panelTypes = await page.evaluate(() => {
// @grafana/plugin-e2e doesn't export the full bootdata config
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
const win = window as typeof window & { grafanaBootData: GrafanaBootConfig['bootData'] };
return win.grafanaBootData?.settings?.panels ?? {};
});
// Loop through every panel type and ensure no crash
for (const [_, panel] of Object.entries(panelTypes)) {
// Skip hidden and deprecated panels
if (!panel.hideFromList && panel.state !== 'deprecated') {
// Open visualization picker
const vizPicker = dashboardPage.getByGrafanaSelector(selectors.components.PanelEditor.toggleVizPicker);
await vizPicker.click();
await dashboardPage.getByGrafanaSelector(selectors.components.PluginVisualization.item(panel.name)).click();
// Verify panel type is selected
await expect(vizPicker).toHaveText(panel.name);
// Ensure no unexpected error occurred
await expect(page.getByText('An unexpected error happened')).toBeHidden();
}
}
});
}
);