openpencil/tests/helpers/chat/fixture.ts
Danila Poyarkov b9731f6a90 test(chat): isolate domain specs and real LLM runs
- Replace the shared serial page with isolated configured-chat fixtures\n- Split composer, attachment, Markdown, profile, navigation, and response behavior\n- Use Playwright's structured @real-llm tag with a credential-gated config\n- Keep mock stream construction and page operations in focused helpers
2026-09-04 11:50:12 +03:00

28 lines
760 B
TypeScript

import { test as base, expect } from '@playwright/test'
import { CanvasHelper } from '#tests/helpers/canvas'
import { ChatHarness } from '#tests/helpers/chat/harness'
import { injectMockChatTransport } from '#tests/helpers/chat/transport'
interface ChatFixtures {
chat: ChatHarness
configuredChat: ChatHarness
}
export const test = base.extend<ChatFixtures>({
chat: async ({ page }, use) => {
const harness = new ChatHarness(page)
await harness.open()
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
await injectMockChatTransport(page)
await use(harness)
},
configuredChat: async ({ chat }, use) => {
await chat.configureOpenRouter('sk-or-test-key-12345')
await use(chat)
}
})
export { expect }