aboutsummaryrefslogtreecommitdiffstats
path: root/playwright.config.ts
diff options
context:
space:
mode:
Diffstat (limited to 'playwright.config.ts')
-rw-r--r--playwright.config.ts37
1 files changed, 37 insertions, 0 deletions
diff --git a/playwright.config.ts b/playwright.config.ts
new file mode 100644
index 00000000..f245b4e4
--- /dev/null
+++ b/playwright.config.ts
@@ -0,0 +1,37 @@
+import { defineConfig, devices } from "@playwright/test";
+
+const port = Number(process.env.E2E_PORT || 4173);
+const host = process.env.E2E_HOST || "127.0.0.1";
+const baseURL = process.env.E2E_BASE_URL || `http://${host}:${port}`;
+
+export default defineConfig({
+ testDir: "./test/e2e",
+ timeout: 30_000,
+ expect: {
+ timeout: 10_000,
+ },
+ fullyParallel: true,
+ forbidOnly: !!process.env.CI,
+ retries: process.env.CI ? 2 : 0,
+ workers: process.env.CI ? 1 : undefined,
+ reporter: [["list"]],
+ use: {
+ baseURL,
+ trace: "on-first-retry",
+ },
+ projects: [
+ {
+ name: "chromium",
+ use: { ...devices["Desktop Chrome"] },
+ },
+ ],
+ webServer: process.env.E2E_SKIP_WEBSERVER
+ ? undefined
+ : {
+ command: `PUBLIC_RECAPTCHA_SITE_KEY= bunx vite dev --host ${host} --port ${port}`,
+ url: baseURL,
+ reuseExistingServer: true,
+ stdout: "pipe",
+ stderr: "pipe",
+ },
+});