Files
jobtrackingapp/job-tracker-ui/playwright.cv-ai.config.ts
T

64 lines
2.4 KiB
TypeScript

import { defineConfig } from "@playwright/test";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
// Separate real-HTTP contract suite. Neither process uses the normal browser-suite ports.
const apiUrl = "http://127.0.0.1:15313";
const providerUrl = "http://127.0.0.1:18133";
const dataRoot = process.env.CV_AI_READINESS_DATA_ROOT ??= fs.mkdtempSync(path.join(os.tmpdir(), "jobtracker-cv-ai-readiness-"));
process.env.CV_AI_READINESS_API_URL = apiUrl;
process.env.CV_AI_READINESS_PROVIDER_URL = providerUrl;
const quote = (value: string) => `"${value.replaceAll('"', '\\"')}"`;
export default defineConfig({
testDir: "./ai-tests",
testMatch: "cv-ai-readiness.spec.ts",
workers: 1,
fullyParallel: false,
retries: 0,
timeout: 90_000,
reporter: "list",
outputDir: "test-results/cv-ai-readiness",
webServer: [
{
command: `${quote(process.execPath)} ${quote(path.resolve("scripts/cv-ai-provider-fixture.mjs"))} --port 18133`,
url: `${providerUrl}/health`,
reuseExistingServer: false,
timeout: 30_000,
},
{
command: `${quote(process.env.DOTNET_HOST_PATH || "dotnet")} run --no-build --configuration Release --project ../JobTrackerApi/JobTrackerApi.csproj --urls ${apiUrl}`,
url: `${apiUrl}/ready`,
reuseExistingServer: false,
timeout: 120_000,
env: {
ASPNETCORE_ENVIRONMENT: "Development",
Auth__Require: "true",
Auth__JwtKey: "cv-ai-readiness-only-key-at-least-thirty-two-characters",
Auth__AdminEmail: "cv-ai-readiness@example.test",
Auth__AdminPassword: "E2ePassword123!",
Auth__AllowRegistration: "false",
RateLimits__AuthLoginPermitLimit: "100",
Data__Root: dataRoot,
Database__Provider: "sqlite",
ConnectionStrings__JobTracker: `Data Source=${path.join(dataRoot, "readiness.sqlite")}`,
HttpsRedirection__Enabled: "false",
Ai__BaseUrl: providerUrl,
Ai__ServiceToken: "",
Ai__ProbeEnabled: "false",
Auth__GoogleClientId: "",
Auth__MicrosoftClientId: "",
Email__Enabled: "false",
Stripe__SecretKey: "",
Backups__Enabled: "false",
Workers__AiOperationsEnabled: "false",
Workers__RulesEnabled: "false",
Workers__FollowUpRemindersEnabled: "false",
Workers__DailyExportEnabled: "false",
Workers__JobEnrichmentEnabled: "false",
},
},
],
});