Files
alchemist/web-e2e/playwright.config.ts
2026-04-16 11:37:48 -04:00

54 lines
1.5 KiB
TypeScript

import { defineConfig } from "@playwright/test";
import { BASE_URL, CONFIG_PATH, DB_PATH, PORT } from "./testConfig";
export default defineConfig({
testDir: "./tests",
fullyParallel: false,
workers: 1,
retries: 0,
timeout: 60_000,
expect: {
timeout: 10_000,
},
reporter: "list",
globalSetup: "./global-setup.ts",
use: {
baseURL: BASE_URL,
headless: true,
trace: "retain-on-failure",
screenshot: "only-on-failure",
video: "retain-on-failure",
},
projects: [
{
name: "auth",
testIgnore: /setup-recovery\.spec\.ts/,
use: {
storageState: ".runtime/auth-state.json",
},
},
{
name: "setup",
testMatch: /setup-recovery\.spec\.ts/,
use: {
storageState: undefined,
},
},
],
webServer: {
command:
"sh -c 'mkdir -p .runtime/media && rm -f .runtime/alchemist.db .runtime/alchemist.db-wal .runtime/alchemist.db-shm && cd .. && (cd web && bun install --frozen-lockfile && bun run build) && if [ -x ./target/debug/alchemist ]; then ./target/debug/alchemist --reset-auth; else cargo run --locked --no-default-features -- --reset-auth; fi'",
url: `${BASE_URL}/api/health`,
reuseExistingServer: false,
timeout: 300_000,
env: {
ALCHEMIST_CONFIG_PATH: CONFIG_PATH,
ALCHEMIST_DB_PATH: DB_PATH,
ALCHEMIST_CONFIG_MUTABLE: "true",
ALCHEMIST_SERVER_PORT: String(PORT),
CARGO_INCREMENTAL: "0",
RUST_LOG: "warn",
},
},
});