test(web): add shared Playwright E2E helpers and search-space fixture

This commit is contained in:
Anish Sarkar 2026-05-06 17:21:40 +05:30
parent a2976ee0b6
commit ae0caad292
10 changed files with 673 additions and 0 deletions

View file

@ -0,0 +1,21 @@
import type { Page } from "@playwright/test";
import { expect } from "@playwright/test";
/**
* Navigation helpers for dashboard routes. Centralized so that future
* route changes only require an update in one place.
*/
export function newChatUrl(searchSpaceId: number): string {
return `/dashboard/${searchSpaceId}/new-chat`;
}
export function connectorsCallbackUrl(searchSpaceId: number): string {
return `/dashboard/${searchSpaceId}/connectors/callback`;
}
export async function gotoNewChat(page: Page, searchSpaceId: number): Promise<void> {
const target = newChatUrl(searchSpaceId);
await page.goto(target, { waitUntil: "domcontentloaded" });
await expect(page).toHaveURL((url) => url.pathname === target);
}