mirror of
https://github.com/Narcooo/inkos.git
synced 2026-08-28 23:02:03 +08:00
37f7a5562f
Two tests covering real DOM click paths through StoryPlayer: - good ending path (trust >= 1 via trustup choice, conditional option visible) - bad ending path (trust = 0, conditional option hidden by count 0) Seed fixture writes story-graph.json to test-project/ before browser launch. INKOS_PROJECT_ROOT points to test-project/ so GET /api/v1/project succeeds.
23 lines
776 B
TypeScript
23 lines
776 B
TypeScript
import { defineConfig } from "@playwright/test";
|
|
|
|
export default defineConfig({
|
|
testDir: "./e2e",
|
|
timeout: 60_000,
|
|
use: {
|
|
baseURL: "http://localhost:4567",
|
|
headless: true,
|
|
screenshot: "only-on-failure",
|
|
},
|
|
// Reuse already-running dev server; start one if none is running.
|
|
// INKOS_PROJECT_ROOT points to test-project/ which has an inkos.json,
|
|
// so the API /api/v1/project endpoint returns valid JSON and the React
|
|
// app can reach the ready state.
|
|
webServer: {
|
|
command: "INKOS_STUDIO_PORT=4569 INKOS_PROJECT_ROOT=../../test-project tsx watch --clear-screen=false src/api/index.ts & vite --host --port 4567 ; kill %1 2>/dev/null",
|
|
url: "http://localhost:4567",
|
|
reuseExistingServer: true,
|
|
timeout: 120_000,
|
|
cwd: ".",
|
|
},
|
|
});
|