mirror of
https://github.com/getpaseo/paseo.git
synced 2026-08-15 04:42:45 +00:00
Adds a `withWorkspace` Playwright fixture plus composable helpers (permissions, sidebar, composer, agent-stream, settings) so specs read as user-level intent. Migrates workspace-lifecycle and settings-host-page to the new DSL as proof.
18 lines
782 B
TypeScript
18 lines
782 B
TypeScript
import { expect, type Page } from "@playwright/test";
|
|
|
|
export async function awaitAssistantMessage(page: Page, hasText?: string | RegExp): Promise<void> {
|
|
const messages = page.getByTestId("assistant-message");
|
|
const target = hasText === undefined ? messages.first() : messages.filter({ hasText }).first();
|
|
await expect(target).toBeVisible({ timeout: 30_000 });
|
|
}
|
|
|
|
export async function awaitToolCall(page: Page, toolName: string | RegExp): Promise<void> {
|
|
await expect(
|
|
page.getByTestId("tool-call-badge").filter({ hasText: toolName }).first(),
|
|
).toBeVisible({ timeout: 30_000 });
|
|
}
|
|
|
|
export async function expectAgentIdle(page: Page, timeout = 30_000): Promise<void> {
|
|
await expect(page.getByRole("button", { name: /stop|cancel/i })).toHaveCount(0, { timeout });
|
|
}
|