import type { APIRequestContext } from '@playwright/test'; export async function createEmptyDocument(request: APIRequestContext): Promise { const res = await request.post('/api/documents', { multipart: { title: 'E2E Transcribe Coach Test' } }); if (!res.ok()) throw new Error(`Create document failed: ${res.status()}`); const doc = await res.json(); return doc.id as string; }