- 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
28 lines
760 B
TypeScript
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 }
|