mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
dd06dd89d1
The showcase framework directories better reflect their role as integration examples rather than distributable packages. Renames showcase/packages/ -> showcase/integrations/ and updates the test docker-compose file reference accordingly.
28 lines
1.0 KiB
TypeScript
28 lines
1.0 KiB
TypeScript
import { test, expect } from "@playwright/test";
|
|
|
|
test.describe("Readonly State (Agent Context)", () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.goto("/demos/readonly-state-agent-context");
|
|
});
|
|
|
|
test("context card renders with default fields", async ({ page }) => {
|
|
await expect(page.locator('[data-testid="context-card"]')).toBeVisible();
|
|
await expect(page.locator('[data-testid="ctx-name"]')).toHaveValue("Atai");
|
|
});
|
|
|
|
test("published context JSON reflects initial state", async ({ page }) => {
|
|
const json = page.locator('[data-testid="ctx-state-json"]');
|
|
await expect(json).toContainText("Atai");
|
|
await expect(json).toContainText("America/Los_Angeles");
|
|
});
|
|
|
|
test("sends a message and gets a reply", async ({ page }) => {
|
|
const input = page.locator('textarea, [placeholder*="message"]').first();
|
|
await input.fill("What do you know about me?");
|
|
await input.press("Enter");
|
|
await expect(page.locator('[data-role="assistant"]').first()).toBeVisible({
|
|
timeout: 30000,
|
|
});
|
|
});
|
|
});
|