Breaks the monolithic planner.test.ts (581 lines, 25 tests) into five focused files grouped by feature area, with BRouter mocked by default via test.beforeEach in files that need routing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 lines
444 B
TypeScript
12 lines
444 B
TypeScript
import type { APIRequestContext, Page } from "@playwright/test";
|
|
|
|
export async function createSession(request: APIRequestContext): Promise<string> {
|
|
const response = await request.post("/api/sessions", { data: {} });
|
|
const { url } = await response.json();
|
|
return url;
|
|
}
|
|
|
|
export async function openSession(page: Page, url: string): Promise<void> {
|
|
await page.goto(url);
|
|
await page.getByText("Connected").waitFor({ timeout: 15000 });
|
|
}
|