* Dynamic dashboards sidebar wip * Progress * Outline in view mode cannot change name * Only one pane at a time * Adding starbutton and custom precence * undo / redo working * Progress * Update * Progress * Update * Public badge, provisining badge * playlist stop * Update * some initial unit tests * Fix export tooltip * Close pane when leaving edit mode if pane is an element * Update * e2e fixes * fixing e2e * Fix lint suppressions * e2e fixes * fixing more e2e * fixing e2e * fix e2e * e2e fixes * Fixinfg e2e * fixing e2e
49 lines
1.6 KiB
TypeScript
49 lines
1.6 KiB
TypeScript
import { test, expect } from '@grafana/plugin-e2e';
|
|
|
|
test.use({
|
|
featureToggles: {
|
|
kubernetesDashboards: true,
|
|
dashboardNewLayouts: true,
|
|
dashboardUndoRedo: true,
|
|
groupByVariable: true,
|
|
},
|
|
});
|
|
|
|
const PAGE_UNDER_TEST = 'kVi2Gex7z/test-variable-output';
|
|
const DASHBOARD_NAME = 'Test variable output';
|
|
|
|
test.describe(
|
|
'Dashboard panels',
|
|
{
|
|
tag: ['@dashboards'],
|
|
},
|
|
() => {
|
|
test('can add a new panel', async ({ gotoDashboardPage, selectors, page }) => {
|
|
const dashboardPage = await gotoDashboardPage({ uid: PAGE_UNDER_TEST });
|
|
await expect(page.getByText(DASHBOARD_NAME)).toBeVisible();
|
|
|
|
const undockButton = page.getByRole('button', { name: 'Undock menu' });
|
|
await undockButton.click();
|
|
|
|
await dashboardPage.getByGrafanaSelector(selectors.components.NavToolbar.editDashboard.editButton).click();
|
|
|
|
await page.evaluate(() => {
|
|
window.scrollTo(0, document.body.scrollHeight);
|
|
});
|
|
await dashboardPage.getByGrafanaSelector(selectors.components.CanvasGridAddActions.addPanel).last().click();
|
|
|
|
// Check that new panel has been added
|
|
await expect(
|
|
dashboardPage.getByGrafanaSelector(selectors.components.Panels.Panel.title('New panel'))
|
|
).toBeVisible();
|
|
|
|
// Check that pressing the configure button shows the panel editor
|
|
await dashboardPage
|
|
.getByGrafanaSelector(selectors.components.Panels.Panel.content)
|
|
.filter({ hasText: 'Configure' })
|
|
.click();
|
|
await expect(dashboardPage.getByGrafanaSelector(selectors.components.PanelEditor.General.content)).toBeVisible();
|
|
});
|
|
}
|
|
);
|