Files
kima-hub/frontend/playwright.config.ts
Your Name d6e414f2d1 ci: add full test suite and GitHub Actions CI agents
- Rewrite pr-checks.yml: typecheck (frontend + backend), backend unit
  tests (Jest, webhookEventStore excluded), dep audit, Docker build gate
- Add integration.yml: Docker stack + Playwright e2e on push to main or
  run-e2e label (predeploy, queue, playlists, api-contracts, security)
- Add nightly.yml: full Playwright suite at 03:00 UTC, opens GH issue on
  failure
- Add security.yml: npm audit blocking on critical + security.spec.ts
  against Docker stack on PRs and weekly

New tests:
- security.spec.ts: IDOR, XSS, unauthenticated access, input validation,
  mass assignment (12 tests, all verified against localhost:3030)
- api-contracts.spec.ts: auth shapes, CRUD contracts, library/search
  validation, health check (15 tests, all verified)
- playlists.spec.ts, queue.spec.ts: functional e2e tests
- global.setup.ts: shared auth token setup

Backend fixes:
- Fix discoverySeeding tests: add _max.playedAt to recentPlays mocks,
  sync getFallbackSeedArtists mock to new artist.findMany+albums path,
  add unavailableAlbum to Prisma mock factory
- Fix enrichmentStateMachine tests: add clearGate to mock, update
  orphaned-audio assertion to match new where clause
- Add p-queue.cjs CJS mock + moduleNameMapper (pure ESM incompatible
  with Jest CJS runner)
- Add typecheck scripts to frontend/backend package.json

scripts/create-e2e-user.sh: fix bcrypt hash corruption by passing
password via Docker -e env var instead of shell interpolation
2026-03-16 10:42:20 -05:00

35 lines
764 B
TypeScript

import { defineConfig } from "@playwright/test";
const baseURL = process.env.KIMA_UI_BASE_URL || "http://127.0.0.1:3030";
export default defineConfig({
testDir: "./tests/e2e",
timeout: 60_000,
expect: { timeout: 15_000 },
retries: process.env.CI ? 2 : 0,
globalSetup: "./tests/e2e/global.setup.ts",
use: {
baseURL,
trace: "retain-on-failure",
screenshot: "only-on-failure",
video: "retain-on-failure",
},
reporter: [["list"], ["html", { open: "never" }]],
webServer: process.env.KIMA_E2E_START_WEB
? {
command: "npm run dev",
url: baseURL,
reuseExistingServer: true,
timeout: 120_000,
}
: undefined,
});