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");
|
2026-04-21 17:44:25 -03:00
|
|
|
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"),
|
2026-04-21 15:20:34 -03:00
|
|
|
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: {
|
2026-04-21 17:44:25 -03:00
|
|
|
command: webServerCommand,
|
2026-04-11 00:02:26 -03:00
|
|
|
cwd: frontendRoot,
|
|
|
|
|
url: "http://127.0.0.1:4173",
|
|
|
|
|
reuseExistingServer: !process.env.CI,
|
2026-04-21 17:44:25 -03:00
|
|
|
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") }]],
|
|
|
|
|
});
|