diff options
| author | Adam <[email protected]> | 2026-01-19 05:22:35 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2026-01-19 09:03:52 -0600 |
| commit | 182c43a78f55d4c22440c7256cbf4ff464e01c6e (patch) | |
| tree | dc9e7ecfc0f15192a69fc18c0ae08af675d4bde0 /packages/app/e2e/fixtures.ts | |
| parent | f1daf3b4308cf85a3f61fb2f1d4b3f55316487b1 (diff) | |
| download | opencode-182c43a78f55d4c22440c7256cbf4ff464e01c6e.tar.gz opencode-182c43a78f55d4c22440c7256cbf4ff464e01c6e.zip | |
chore: cleanup
Diffstat (limited to 'packages/app/e2e/fixtures.ts')
| -rw-r--r-- | packages/app/e2e/fixtures.ts | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/packages/app/e2e/fixtures.ts b/packages/app/e2e/fixtures.ts new file mode 100644 index 000000000..721d60049 --- /dev/null +++ b/packages/app/e2e/fixtures.ts @@ -0,0 +1,40 @@ +import { test as base, expect } from "@playwright/test" +import { createSdk, dirSlug, getWorktree, promptSelector, sessionPath } from "./utils" + +type TestFixtures = { + sdk: ReturnType<typeof createSdk> + gotoSession: (sessionID?: string) => Promise<void> +} + +type WorkerFixtures = { + directory: string + slug: string +} + +export const test = base.extend<TestFixtures, WorkerFixtures>({ + directory: [ + async ({}, use) => { + const directory = await getWorktree() + await use(directory) + }, + { scope: "worker" }, + ], + slug: [ + async ({ directory }, use) => { + await use(dirSlug(directory)) + }, + { scope: "worker" }, + ], + sdk: async ({ directory }, use) => { + await use(createSdk(directory)) + }, + gotoSession: async ({ page, directory }, use) => { + const gotoSession = async (sessionID?: string) => { + await page.goto(sessionPath(directory, sessionID)) + await expect(page.locator(promptSelector)).toBeVisible() + } + await use(gotoSession) + }, +}) + +export { expect } |
