mirror of
https://github.com/anomalyco/opencode.git
synced 2026-02-01 22:48:16 +00:00
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import { defineConfig, devices } from "@playwright/test"
|
|
|
|
const port = Number(process.env.PLAYWRIGHT_PORT ?? 3000)
|
|
const baseURL = process.env.PLAYWRIGHT_BASE_URL ?? `http://localhost:${port}`
|
|
const serverHost = process.env.PLAYWRIGHT_SERVER_HOST ?? "localhost"
|
|
const serverPort = process.env.PLAYWRIGHT_SERVER_PORT ?? "4096"
|
|
const command = `bun run dev -- --host 0.0.0.0 --port ${port}`
|
|
const reuse = !process.env.CI
|
|
const win = process.platform === "win32"
|
|
|
|
export default defineConfig({
|
|
testDir: "./e2e",
|
|
outputDir: "./e2e/test-results",
|
|
timeout: 60_000,
|
|
expect: {
|
|
timeout: 10_000,
|
|
},
|
|
fullyParallel: !win,
|
|
workers: win ? 1 : undefined,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 2 : 0,
|
|
reporter: [["html", { outputFolder: "e2e/playwright-report", open: "never" }], ["line"]],
|
|
webServer: {
|
|
command,
|
|
url: baseURL,
|
|
reuseExistingServer: reuse,
|
|
timeout: 120_000,
|
|
env: {
|
|
VITE_OPENCODE_SERVER_HOST: serverHost,
|
|
VITE_OPENCODE_SERVER_PORT: serverPort,
|
|
},
|
|
},
|
|
use: {
|
|
baseURL,
|
|
trace: "on-first-retry",
|
|
screenshot: "only-on-failure",
|
|
video: "retain-on-failure",
|
|
},
|
|
projects: [
|
|
{
|
|
name: "chromium",
|
|
use: { ...devices["Desktop Chrome"] },
|
|
},
|
|
],
|
|
})
|