import { defineConfig } from "@playwright/test"; // E2E smoke test drives the REAL stack: one uvicorn process serves both the API // and the built frontend (same-origin /api). The frontend must be built first // (`npm run build`) so space_app can serve frontend/dist. const PORT = 7860; export default defineConfig({ testDir: "./e2e", timeout: 60_000, fullyParallel: false, reporter: [["list"]], use: { baseURL: `http://127.0.0.1:${PORT}`, headless: true, }, webServer: { command: `bash -c "cd .. && uvicorn space_app.main:app --host 127.0.0.1 --port ${PORT}"`, url: `http://127.0.0.1:${PORT}/api/puzzles?puzzle_type=bridges&difficulty=medium`, timeout: 180_000, reuseExistingServer: true, env: { // Keep the e2e run off the real /data dir; reuse the existing HF dataset cache. TOPOBENCH_DATA_DIR: "/tmp/topobench_e2e", HF_HOME: `${process.env.HOME}/.cache/huggingface`, SDL_AUDIODRIVER: "dummy", SDL_VIDEODRIVER: "dummy", PYTHONWARNINGS: "ignore", }, }, });