Files
jobtrackingapp/job-tracker-ui/playwright.config.ts
T
cesnimda b5249357c7
CI and Deploy / test (push) Failing after 30s
CI and Deploy / deploy (push) Has been skipped
feat(cv): rebuild section editing workflow
2026-08-27 15:27:54 +02:00

55 lines
1.9 KiB
TypeScript

import { defineConfig, devices, chromium } from "@playwright/test";
import os from "node:os";
import path from "node:path";
const apiUrl = "http://localhost:5302";
const appUrl = "http://localhost:3300";
const dataRoot = path.join(os.tmpdir(), `jobtracker-e2e-${process.pid}-${Date.now().toString(36)}`);
const reuseServers = process.env.PLAYWRIGHT_REUSE_SERVERS === "true";
const useStaticExport = process.env.PLAYWRIGHT_STATIC_EXPORT === "true";
export default defineConfig({
testDir: "./e2e",
fullyParallel: false,
workers: 1,
retries: process.env.CI ? 1 : 0,
reporter: process.env.CI ? "github" : "list",
use: {
baseURL: appUrl,
trace: "retain-on-failure",
screenshot: "only-on-failure",
},
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
webServer: [
{
command: "dotnet run --no-build --configuration Release --project ../JobTrackerApi/JobTrackerApi.csproj --urls http://localhost:5302",
url: `${apiUrl}/health`,
timeout: 120_000,
reuseExistingServer: reuseServers,
env: {
ASPNETCORE_ENVIRONMENT: "Development",
Auth__Require: "true",
Auth__JwtKey: "e2e-only-key-at-least-thirty-two-characters-long",
Auth__AdminEmail: "e2e@example.test",
Auth__AdminPassword: "E2ePassword123!",
Auth__AllowRegistration: "false",
App__Version: "e2e-verification",
App__CommitSha: "e2e1234",
Cors__Origins__0: appUrl,
Data__Root: dataRoot,
HttpsRedirection__Enabled: "false",
CV_PDF_BROWSER_PATH: chromium.executablePath(),
},
},
{
command: useStaticExport
? "npm run build && npm run serve:export"
: "npm run dev -- --hostname localhost --port 3300",
url: appUrl,
timeout: 120_000,
reuseExistingServer: reuseServers,
env: { NEXT_PUBLIC_API_BASE_URL: `${apiUrl}/api` },
},
],
});