summaryrefslogtreecommitdiffhomepage
path: root/packages/app/playwright.config.ts
diff options
context:
space:
mode:
authorAdam <[email protected]>2026-01-17 20:52:21 -0600
committerAdam <[email protected]>2026-01-19 09:03:52 -0600
commit03d7467ea268f2f0f8d99f48ea1522741014b4bf (patch)
tree5df719dfef2b7d67fad86405a99cd2375174c41b /packages/app/playwright.config.ts
parent23e9c02a7fd80063dd49e3b9cbd2a0c6519034bc (diff)
downloadopencode-03d7467ea268f2f0f8d99f48ea1522741014b4bf.tar.gz
opencode-03d7467ea268f2f0f8d99f48ea1522741014b4bf.zip
test(app): initial e2e test setup
Diffstat (limited to 'packages/app/playwright.config.ts')
-rw-r--r--packages/app/playwright.config.ts43
1 files changed, 43 insertions, 0 deletions
diff --git a/packages/app/playwright.config.ts b/packages/app/playwright.config.ts
new file mode 100644
index 000000000..10819e69f
--- /dev/null
+++ b/packages/app/playwright.config.ts
@@ -0,0 +1,43 @@
+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
+
+export default defineConfig({
+ testDir: "./e2e",
+ outputDir: "./e2e/test-results",
+ timeout: 60_000,
+ expect: {
+ timeout: 10_000,
+ },
+ fullyParallel: true,
+ 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"] },
+ },
+ ],
+})