You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chajia/playwright.config.ts

34 lines
984 B

import { defineConfig, devices } from "@playwright/test";
const PORT = process.env.E2E_PORT ?? "3000";
const BASE_URL = process.env.E2E_BASE_URL ?? `http://localhost:${PORT}`;
export default defineConfig({
testDir: "./e2e",
testMatch: "**/*.test.ts",
timeout: 60_000,
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: [["list"], ["html", { open: "never" }]],
use: {
baseURL: BASE_URL,
trace: "on-first-retry",
locale: "zh-CN",
},
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
webServer: {
command: `npm run dev -- -p ${PORT}`,
url: BASE_URL,
reuseExistingServer: !process.env.CI,
timeout: 180_000,
env: {
PORT,
JWT_SECRET: "e2e-test-jwt-secret-32chars-minimum!",
HOST_SERVICE_TOKENS:
'{"demo-host-token":{"customerId":"CUST_001","permissions":["pricing:markup:write"]}}',
},
},
});