Files

44 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

import { defineConfig, devices } from "@playwright/test";
import { fileURLToPath } from "node:url";
const E2E_DB = process.env.E2E_DATABASE_URL ?? "postgres://retro:retro@localhost:5433/retro_e2e";
const serverDir = fileURLToPath(new URL("../server", import.meta.url));
const webDir = fileURLToPath(new URL("../web", import.meta.url));
export default defineConfig({
testDir: "./tests",
timeout: 30_000,
expect: { timeout: 10_000 },
fullyParallel: false,
workers: 1,
globalSetup: "./global-setup.ts",
reporter: [["list"]],
use: {
baseURL: "http://localhost:5173",
locale: "en-US", // i18n -> inglés determinista
trace: "on-first-retry",
},
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
webServer: [
{
command: "npm run serve",
cwd: serverDir,
port: 3001,
reuseExistingServer: !process.env.CI,
timeout: 60_000,
env: {
DATABASE_URL: E2E_DB,
PORT: "3001",
WEB_ORIGIN: "http://localhost:5173",
},
},
{
command: "npm run dev",
cwd: webDir,
port: 5173,
reuseExistingServer: !process.env.CI,
timeout: 60_000,
},
],
});