import { test, expect } from '@playwright/test';
test('dashboard loads with correct panels', async ({ page }) => {
await page.goto('http://localhost:3000/d/dashboard-id');
// Login if required
await page.fill('[name="user"]', 'admin');
await page.fill('[name="password"]', 'admin');
await page.click('[type="submit"]');
// Verify dashboard elements
await expect(page.locator('.panel-title')).toContainText('CPU Usage');
await expect(page.locator('.graph-panel')).toBeVisible();
});
test('alert rule triggers correctly', async ({ page }) => {
await page.goto('http://localhost:3000/alerting/list');
// Check alert status
await expect(page.locator('[data-testid="alert-rule"]')).toBeVisible();
await expect(page.locator('.alert-state-ok')).toContainText('OK');
});