Files
Egutierrez 1d3744f2d7 test(e2e): Playwright UI smoke + Go integration tests against MAS
- Playwright e2e against Vite dev server (LoginScreen renders, homeserver
  visible, version pinned). Fallback documented to swap to `wails dev
  -browser` via WAILS_DEV_URL when full backend bindings are required.
- Go integration tests (//go:build integration,goolm) for Start +
  ListRooms + LoadTimeline + SendText + GetDiagnostics against real
  Synapse. Skip cleanly if MATRIX_INTEGRATION_TOKEN/USER env vars unset
  so CI never breaks unattended.
- pnpm e2e/e2e:ui/e2e:report scripts. Per-run keyring namespace +
  t.TempDir XDG_CONFIG_HOME so integration tests don't clobber the
  production keyring entry.

E2E.md explains how to run each layer + limits (OIDC not automated).
2026-05-25 17:20:05 +02:00

36 lines
1.2 KiB
TypeScript

import { defineConfig } from "@playwright/test";
// E2E config — runs Vite dev server (not full `wails dev`) on a fixed port so
// Playwright can hit the React UI without needing the Go backend compiled with
// goolm. LoginScreen + initial App boot render fine because the only Wails
// runtime call (GetLastUserID) throws inside a try/finally that flips the
// loading overlay off. See E2E.md for the rationale + how to swap to `wails
// dev -browser` if/when the full backend is available.
const DEV_PORT = Number(process.env.WAILS_E2E_PORT || 5180);
const BASE_URL = process.env.WAILS_DEV_URL || `http://localhost:${DEV_PORT}`;
export default defineConfig({
testDir: "./e2e",
timeout: 30_000,
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1,
reporter: process.env.CI ? "github" : "list",
use: {
baseURL: BASE_URL,
headless: true,
trace: "on-first-retry",
screenshot: "only-on-failure",
},
webServer: {
command: `pnpm dev --port ${DEV_PORT} --strictPort`,
url: BASE_URL,
timeout: 60_000,
reuseExistingServer: !process.env.CI,
stdout: "pipe",
stderr: "pipe",
},
});