cloudaxe-opencode/packages/app/e2e/session.spec.ts

22 lines
717 B
TypeScript
Raw Permalink Normal View History

2026-01-19 11:22:35 +00:00
import { test, expect } from "./fixtures"
import { promptSelector } from "./utils"
2026-01-18 11:15:34 +00:00
2026-01-19 11:22:35 +00:00
test("can open an existing session and type into the prompt", async ({ page, sdk, gotoSession }) => {
2026-01-18 11:15:34 +00:00
const title = `e2e smoke ${Date.now()}`
const created = await sdk.session.create({ title }).then((r) => r.data)
if (!created?.id) throw new Error("Session create did not return an id")
const sessionID = created.id
try {
2026-01-19 11:22:35 +00:00
await gotoSession(sessionID)
2026-01-18 11:15:34 +00:00
2026-01-18 11:43:34 +00:00
const prompt = page.locator(promptSelector)
2026-01-18 11:15:34 +00:00
await prompt.click()
await page.keyboard.type("hello from e2e")
await expect(prompt).toContainText("hello from e2e")
} finally {
await sdk.session.delete({ sessionID }).catch(() => undefined)
}
})