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.
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import { test, expect } from "@playwright/test";
|
|
|
|
test.describe("Tool Rendering (Reasoning Chain)", () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.goto("/demos/tool-rendering-reasoning-chain");
|
|
});
|
|
|
|
test("chat UI renders on load", async ({ page }) => {
|
|
await expect(page.getByPlaceholder(/type a message/i)).toBeVisible();
|
|
});
|
|
|
|
test("weather prompt triggers reasoning + WeatherCard", async ({ page }) => {
|
|
const input = page.getByPlaceholder(/type a message/i);
|
|
await input.fill("What's the weather in Tokyo?");
|
|
await input.press("Enter");
|
|
|
|
// Custom reasoning block appears.
|
|
await expect(
|
|
page.locator('[data-testid="reasoning-block"]').first(),
|
|
).toBeVisible({ timeout: 60000 });
|
|
|
|
// Per-tool WeatherCard renders.
|
|
await expect(
|
|
page.locator('[data-testid="weather-card"]').first(),
|
|
).toBeVisible({ timeout: 60000 });
|
|
});
|
|
|
|
test("dice prompt triggers the catch-all renderer", async ({ page }) => {
|
|
const input = page.getByPlaceholder(/type a message/i);
|
|
await input.fill("Roll a 20-sided die for me.");
|
|
await input.press("Enter");
|
|
|
|
await expect(
|
|
page
|
|
.locator(
|
|
'[data-testid="custom-catchall-card"][data-tool-name="roll_dice"]',
|
|
)
|
|
.first(),
|
|
).toBeVisible({ timeout: 60000 });
|
|
});
|
|
});
|