mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-23 00:41:40 +00:00
test(e2e/agents): add live-stream spec for Validation #4
Inside a session, poll until ≥3 events have rendered in the conversation pane (combination of message bubbles and tool-call cards). Mock provider ticks every 400ms so this lands well under the 10s budget.
This commit is contained in:
parent
bf6017a5b7
commit
50b2ad9482
1 changed files with 28 additions and 0 deletions
|
|
@ -0,0 +1,28 @@
|
|||
/**
|
||||
* LIT-2881 Validation #4 — Live event streaming.
|
||||
*
|
||||
* Inside a session, ≥3 events render in the conversation pane within 10s
|
||||
* (from the mock SSE stream — assistant_message, tool_call, etc.).
|
||||
*/
|
||||
import { test, expect } from "@playwright/test";
|
||||
import { AGENTS_DEV_URL, authenticateAgentsPage } from "./_helpers";
|
||||
|
||||
test("session view streams ≥3 events into the conversation pane", async ({ page }) => {
|
||||
await authenticateAgentsPage(page);
|
||||
await page.goto(`${AGENTS_DEV_URL}/agents/agt_01/sessions/ses_01`);
|
||||
await expect(page.getByTestId("conversation-pane")).toBeVisible();
|
||||
|
||||
// Mock streamer ticks every 400ms; we should see all kinds of events
|
||||
// (the conversation snapshot already has 3 messages + 6 streamed events).
|
||||
// Count visible message bubbles + tool cards + diff entries combined.
|
||||
await expect
|
||||
.poll(
|
||||
async () => {
|
||||
const messages = await page.getByTestId(/^message-bubble-/).count();
|
||||
const tools = await page.getByTestId("tool-call-card").count();
|
||||
return messages + tools;
|
||||
},
|
||||
{ timeout: 10_000, intervals: [200, 500, 1000] },
|
||||
)
|
||||
.toBeGreaterThanOrEqual(3);
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue