Skip to content

Commit 27fff46

Browse files
author
Rory Graves
committed
Add frontend E2E tests for additional pages
- chat.spec.ts: 6 tests for chat page UI elements - analytics.spec.ts: 4 tests for analytics dashboard - config.spec.ts: 7 tests for runtime and collection config - visibility.spec.ts: 5 tests for system visibility page E2E test count: 4 specs → 8 specs (22 new tests)
1 parent 66a9a20 commit 27fff46

4 files changed

Lines changed: 125 additions & 0 deletions

File tree

admin-ui/e2e/analytics.spec.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { test, expect } from '@playwright/test'
2+
3+
test.describe('Analytics', () => {
4+
test.beforeEach(async ({ page }) => {
5+
await page.goto('/analytics')
6+
})
7+
8+
test('should display analytics page with header', async ({ page }) => {
9+
await expect(page.getByRole('heading', { name: 'Analytics' })).toBeVisible()
10+
})
11+
12+
test('should display time range selector', async ({ page }) => {
13+
// Look for time range filter options
14+
await expect(page.getByText(/24 hours|7 days|30 days/i).first()).toBeVisible({ timeout: 10000 })
15+
})
16+
17+
test('should display query stats section', async ({ page }) => {
18+
await expect(page.getByText(/queries|total/i).first()).toBeVisible({ timeout: 10000 })
19+
})
20+
21+
test('should display latency metrics', async ({ page }) => {
22+
await expect(page.getByText(/latency|response time/i).first()).toBeVisible({ timeout: 10000 })
23+
})
24+
})

admin-ui/e2e/chat.spec.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { test, expect } from '@playwright/test'
2+
3+
test.describe('Chat', () => {
4+
test.beforeEach(async ({ page }) => {
5+
await page.goto('/chat')
6+
})
7+
8+
test('should display chat page with header', async ({ page }) => {
9+
await expect(page.getByRole('heading', { name: 'Chat' })).toBeVisible()
10+
})
11+
12+
test('should display collection selector', async ({ page }) => {
13+
await expect(page.getByLabel('Collection')).toBeVisible()
14+
})
15+
16+
test('should display message input area', async ({ page }) => {
17+
await expect(page.getByPlaceholder(/ask a question/i)).toBeVisible()
18+
})
19+
20+
test('should have send button', async ({ page }) => {
21+
const sendButton = page.getByRole('button', { name: /send/i })
22+
await expect(sendButton).toBeVisible()
23+
})
24+
25+
test('should have clear chat button', async ({ page }) => {
26+
const clearButton = page.getByRole('button', { name: /clear/i })
27+
await expect(clearButton).toBeVisible()
28+
})
29+
30+
test('should accept text input', async ({ page }) => {
31+
const input = page.getByPlaceholder(/ask a question/i)
32+
await input.fill('What is RAG?')
33+
await expect(input).toHaveValue('What is RAG?')
34+
})
35+
})

admin-ui/e2e/config.spec.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { test, expect } from '@playwright/test'
2+
3+
test.describe('Configuration', () => {
4+
test.describe('Runtime Config', () => {
5+
test.beforeEach(async ({ page }) => {
6+
await page.goto('/config/runtime')
7+
})
8+
9+
test('should display runtime config page', async ({ page }) => {
10+
await expect(page.getByRole('heading', { name: /runtime|configuration/i })).toBeVisible()
11+
})
12+
13+
test('should display embedding settings section', async ({ page }) => {
14+
await expect(page.getByText(/embedding/i).first()).toBeVisible({ timeout: 10000 })
15+
})
16+
17+
test('should display LLM settings section', async ({ page }) => {
18+
await expect(page.getByText(/llm|model/i).first()).toBeVisible({ timeout: 10000 })
19+
})
20+
21+
test('should display RAG settings section', async ({ page }) => {
22+
await expect(page.getByText(/rag|chunking/i).first()).toBeVisible({ timeout: 10000 })
23+
})
24+
})
25+
26+
test.describe('Collection Config', () => {
27+
test.beforeEach(async ({ page }) => {
28+
await page.goto('/config/collections')
29+
})
30+
31+
test('should display collection config page', async ({ page }) => {
32+
await expect(page.getByRole('heading', { name: /collection/i })).toBeVisible()
33+
})
34+
35+
test('should have add collection button', async ({ page }) => {
36+
await expect(page.getByRole('button', { name: /add|create|new/i })).toBeVisible()
37+
})
38+
})
39+
})

admin-ui/e2e/visibility.spec.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { test, expect } from '@playwright/test'
2+
3+
test.describe('Visibility', () => {
4+
test.beforeEach(async ({ page }) => {
5+
await page.goto('/visibility')
6+
})
7+
8+
test('should display visibility page with header', async ({ page }) => {
9+
await expect(page.getByRole('heading', { name: 'System Visibility' })).toBeVisible()
10+
})
11+
12+
test('should display configuration section', async ({ page }) => {
13+
await expect(page.getByText(/configuration|settings/i).first()).toBeVisible({ timeout: 10000 })
14+
})
15+
16+
test('should display chunks section', async ({ page }) => {
17+
await expect(page.getByText(/chunks/i).first()).toBeVisible({ timeout: 10000 })
18+
})
19+
20+
test('should display system statistics', async ({ page }) => {
21+
await expect(page.getByText(/statistics|stats/i).first()).toBeVisible({ timeout: 10000 })
22+
})
23+
24+
test('should have refresh button', async ({ page }) => {
25+
await expect(page.getByRole('button', { name: /refresh/i })).toBeVisible()
26+
})
27+
})

0 commit comments

Comments
 (0)