clawhub/playwright.config.ts
2026-04-18 20:10:03 -05:00

42 lines
1.0 KiB
TypeScript

import { defineConfig, devices } from "@playwright/test";
const port = Number(process.env.PLAYWRIGHT_PORT || 4173);
const baseURL = process.env.PLAYWRIGHT_BASE_URL || `http://127.0.0.1:${port}`;
export default defineConfig({
testDir: "./e2e",
testMatch: /.*\.pw\.test\.ts/,
timeout: 60_000,
expect: { timeout: 10_000 },
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
reporter: process.env.CI ? [["list"], ["html", { open: "never" }]] : [["list"]],
use: {
baseURL,
trace: "retain-on-failure",
},
webServer: process.env.PLAYWRIGHT_BASE_URL
? undefined
: {
command: "bun run preview -- --host 127.0.0.1 --port 4173",
url: baseURL,
reuseExistingServer: !process.env.CI,
stdout: "ignore",
stderr: "pipe",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
{
name: "mobile-chrome",
use: { ...devices["Pixel 7"] },
},
{
name: "mobile-safari",
use: { ...devices["iPhone 14"] },
},
],
});