mirror of
https://github.com/BradGroux/veritas-kanban.git
synced 2026-08-28 02:44:59 +00:00
test: add governance dashboard e2e coverage (#264)
Co-authored-by: bradgroux <brad@digitalmeld.io>
This commit is contained in:
parent
c89c5e5d7e
commit
3328a79b3f
4 changed files with 139 additions and 0 deletions
34
e2e/dashboard-widgets.spec.ts
Normal file
34
e2e/dashboard-widgets.spec.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { test, expect } from '@playwright/test';
|
||||
import { bypassAuth, cleanupRoutes } from './helpers/auth';
|
||||
|
||||
test.describe('Governance dashboard widgets', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await bypassAuth(page);
|
||||
});
|
||||
|
||||
test.afterEach(async ({ page }) => {
|
||||
await cleanupRoutes(page);
|
||||
});
|
||||
|
||||
test('renders dashboard widgets on the board view', async ({ page }) => {
|
||||
await page.goto('/', { timeout: 15_000 });
|
||||
|
||||
await expect(page.getByText('Loading dashboard…'))
|
||||
.not.toBeVisible({ timeout: 15_000 })
|
||||
.catch(() => {});
|
||||
|
||||
await expect(
|
||||
page.getByRole('heading', { name: /dashboard|governance dashboard/i }).first()
|
||||
).toBeVisible({ timeout: 15_000 });
|
||||
|
||||
await expect(
|
||||
page.locator('text=/Filter|Filters|Time Range|Agent|Status/i').first()
|
||||
).toBeVisible({ timeout: 15_000 });
|
||||
|
||||
await expect(
|
||||
page
|
||||
.locator('text=/Success Rate|Token Usage|Average Run Duration|Monthly Budget|Health/i')
|
||||
.first()
|
||||
).toBeVisible({ timeout: 15_000 });
|
||||
});
|
||||
});
|
||||
36
e2e/drift-monitor.spec.ts
Normal file
36
e2e/drift-monitor.spec.ts
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import { test, expect } from '@playwright/test';
|
||||
import { bypassAuth, cleanupRoutes } from './helpers/auth';
|
||||
|
||||
test.describe('Drift monitor', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await bypassAuth(page);
|
||||
});
|
||||
|
||||
test.afterEach(async ({ page }) => {
|
||||
await cleanupRoutes(page);
|
||||
});
|
||||
|
||||
test('renders alerts and baselines sections', async ({ page }) => {
|
||||
await page.goto('/drift', { timeout: 15_000 });
|
||||
|
||||
await expect(page.getByRole('heading', { name: 'Behavioral Drift Monitor' })).toBeVisible({
|
||||
timeout: 15_000,
|
||||
});
|
||||
await expect(page.getByPlaceholder('Agent ID')).toBeVisible();
|
||||
await expect(page.getByRole('button', { name: 'Analyze Agent' })).toBeVisible();
|
||||
|
||||
await expect(page.getByRole('heading', { name: 'Alerts' })).toBeVisible();
|
||||
await expect(
|
||||
page.locator('text=/No drift alerts for the current filter\.|Severity|Acknowledge/i').first()
|
||||
).toBeVisible({ timeout: 15_000 });
|
||||
|
||||
await expect(page.getByRole('heading', { name: 'Baselines' })).toBeVisible();
|
||||
await expect(
|
||||
page
|
||||
.locator(
|
||||
'text=/No drift baselines have been computed yet\.|Reset Agent Baselines|Samples/i'
|
||||
)
|
||||
.first()
|
||||
).toBeVisible({ timeout: 15_000 });
|
||||
});
|
||||
});
|
||||
45
e2e/feedback.spec.ts
Normal file
45
e2e/feedback.spec.ts
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
import { test, expect } from '@playwright/test';
|
||||
import { bypassAuth, cleanupRoutes } from './helpers/auth';
|
||||
|
||||
test.describe('Feedback panel', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await bypassAuth(page);
|
||||
});
|
||||
|
||||
test.afterEach(async ({ page }) => {
|
||||
await cleanupRoutes(page);
|
||||
});
|
||||
|
||||
test('renders feedback browse state and filters', async ({ page }) => {
|
||||
await page.goto('/', { timeout: 15_000 });
|
||||
|
||||
await expect(page.getByRole('heading', { name: 'User Feedback' })).toBeVisible({
|
||||
timeout: 15_000,
|
||||
});
|
||||
await page.getByRole('tab', { name: 'Browse' }).click();
|
||||
|
||||
await expect(page.getByPlaceholder('Filter by agent')).toBeVisible({ timeout: 15_000 });
|
||||
await expect(
|
||||
page
|
||||
.locator('button[role="combobox"]')
|
||||
.filter({ hasText: /Sentiment|All sentiments/i })
|
||||
.first()
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page
|
||||
.locator('button[role="combobox"]')
|
||||
.filter({ hasText: /Category|All categories/i })
|
||||
.first()
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page
|
||||
.locator('button[role="combobox"]')
|
||||
.filter({ hasText: /Status|All statuses|Unresolved|Resolved/i })
|
||||
.first()
|
||||
).toBeVisible();
|
||||
|
||||
await expect(
|
||||
page.locator('text=/No feedback found\.|Loading…|Resolved|Unresolved/i').first()
|
||||
).toBeVisible({ timeout: 15_000 });
|
||||
});
|
||||
});
|
||||
24
e2e/prompt-registry.spec.ts
Normal file
24
e2e/prompt-registry.spec.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { test, expect } from '@playwright/test';
|
||||
import { bypassAuth, cleanupRoutes } from './helpers/auth';
|
||||
|
||||
test.describe('Prompt registry', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await bypassAuth(page);
|
||||
});
|
||||
|
||||
test.afterEach(async ({ page }) => {
|
||||
await cleanupRoutes(page);
|
||||
});
|
||||
|
||||
test('renders templates view and create controls', async ({ page }) => {
|
||||
await page.goto('/templates', { timeout: 15_000 });
|
||||
|
||||
await expect(page.getByRole('button', { name: 'Templates' })).toBeVisible({ timeout: 15_000 });
|
||||
await expect(page.getByText('Prompt Templates')).toBeVisible({ timeout: 15_000 });
|
||||
await expect(page.getByRole('button', { name: /new template/i })).toBeVisible();
|
||||
|
||||
await expect(
|
||||
page.locator('text=/No description|Variables:|Loading templates|Prompt Templates/i').first()
|
||||
).toBeVisible({ timeout: 15_000 });
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue