Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions e2e/web-ui-sweep/web-ui-sweep.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,16 @@ async function goto(page: Page, route: string, anchor: string) {

test('servers list renders the fleet with KPI counters', async ({ page }) => {
const errors = watchPageErrors(page)
await goto(page, '/servers', '[data-test="kpi-card-total"]')

await expect(page.locator('[data-test="kpi-card-total"]')).toContainText(/\d/)
// An empty fleet (no fixture registered) renders the first-run empty state
// INSTEAD of the KPI tiles — deliberately hidden until a server exists
// (#1049/#1216) — so anchor on whichever of the two the instance should show.
await goto(page, '/servers', '[data-test="kpi-card-total"], [data-test="servers-first-run-empty"]')

if (!SERVER && (await page.locator('[data-test="servers-first-run-empty"]').isVisible())) {
await expect(page.locator('[data-test="kpi-card-total"]')).toHaveCount(0)
} else {
await expect(page.locator('[data-test="kpi-card-total"]')).toContainText(/\d/)
}
if (SERVER) {
await expect(page.locator('[data-test="server-card-title"]', { hasText: SERVER }).first())
.toBeVisible()
Expand Down Expand Up @@ -187,7 +194,15 @@ test('Activity and Usage report the same 24h numbers as the API', async ({ page,
}

// The Usage tile must show the SAME call count the Activity header does.
await goto(page, '/usage', '[data-test="usage-view"]')
// With no upstream configured, /usage shows the first-run CTA instead of the
// charts (#1049) — there is no Usage tile to compare, so stop at the API and
// Activity halves above.
await goto(page, '/usage', '[data-test="usage-view"], [data-test="dashboard-usage-first-run"]')
if (await page.locator('[data-test="dashboard-usage-first-run"]').isVisible()) {
expect(SERVER, `/usage shows the first-run CTA although fixture ${SERVER} is registered`).toBe('')
expect(errors, `page exceptions: ${errors.join(', ')}`).toHaveLength(0)
return
}
await expect(
page.locator('[data-test="usage-calls-tile"] .stat-value'),
'Usage "Calls" disagrees with the call count Activity prints for the same window',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
</svg>
<h3 class="font-semibold text-lg mt-2">Add your first server to see usage</h3>
<p class="text-sm opacity-60 max-w-md">
<p class="text-sm text-base-content/60 max-w-md">
No upstream MCP servers are configured yet, so there is nothing to chart.
Add one and this page will show call volume, token sinks, error rates and a timeline.
</p>
Expand Down
Loading