assessment-model/playwright.config.ts
Jun-te Kim b914aca3ee chore(devcontainer): add Playwright with chromium and a headed noVNC viewer
Mirrors the Model devcontainer's Playwright setup for this Next.js repo, so
agents and humans can drive the running app in a browser.

The image bakes in chromium's apt libraries (as root) and the browser binary
(as vscode, so it lands in that user's cache), meaning a fresh container is
ready to run with no first-use download. The @playwright/test version and the
Dockerfile's PLAYWRIGHT_VERSION are pinned to the same number because Playwright
ties browser builds to a library version.

Also ports Model's headed viewer stack (Xvfb -> fluxbox -> x11vnc -> noVNC on
:6080) as scripts/start_viewer.sh, for watching a headed run.

Cypress is untouched; Playwright specs live in e2e/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 17:15:38 +00:00

33 lines
1.1 KiB
TypeScript

import { defineConfig, devices } from "@playwright/test";
// Cypress still owns the suites under cypress/e2e; Playwright specs live in
// e2e/ so the two don't collide.
export default defineConfig({
testDir: "./e2e",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
reporter: process.env.CI ? "list" : "html",
use: {
baseURL: process.env.PLAYWRIGHT_BASE_URL ?? "http://localhost:3000",
trace: "on-first-retry",
screenshot: "only-on-failure",
},
// Chromium only: it's the single browser baked into the devcontainer image
// (see .devcontainer/Dockerfile). Adding firefox/webkit here means adding
// them there too, or runs fail with "Executable doesn't exist".
projects: [
{ name: "chromium", use: { ...devices["Desktop Chrome"] } },
],
// Boot `next dev` unless something is already serving the base URL, so a dev
// server you already have running gets reused rather than fought over.
webServer: {
command: "npm run dev",
url: "http://localhost:3000",
reuseExistingServer: !process.env.CI,
timeout: 120_000,
},
});