bstein-dev-home/testing/frontend/playwright.config.mjs

31 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

2026-04-11 00:02:26 -03:00
import path from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "../../frontend/node_modules/@playwright/test/index.mjs";
const testingDir = path.dirname(fileURLToPath(import.meta.url));
const frontendRoot = path.resolve(testingDir, "../../frontend");
const previewCommand = "npm run preview -- --host 127.0.0.1 --port 4173 --strictPort";
const webServerCommand = process.env.PLAYWRIGHT_REUSE_DIST === "1" ? previewCommand : `npm run build && ${previewCommand}`;
2026-04-11 00:02:26 -03:00
export default defineConfig({
testDir: path.resolve(testingDir, "e2e"),
workers: 1,
timeout: 60000,
expect: {
timeout: 10000,
},
2026-04-11 00:02:26 -03:00
use: {
baseURL: "http://127.0.0.1:4173",
trace: "on-first-retry",
viewport: { width: 1440, height: 1080 },
},
webServer: {
command: webServerCommand,
2026-04-11 00:02:26 -03:00
cwd: frontendRoot,
url: "http://127.0.0.1:4173",
reuseExistingServer: !process.env.CI,
timeout: process.env.CI ? 420000 : 120000,
2026-04-11 00:02:26 -03:00
},
reporter: [["list"], ["junit", { outputFile: path.resolve(testingDir, "../../build/junit-frontend-e2e.xml") }]],
});