Files
SRCmail/playwright.electron.config.ts
T
Bernd Rodler 9254a7fa20 test(electron): smoke test as the regression gate for the desktop shell
Phase 1 step 2 of VNCprodbuild. e2e/electron-smoke.spec.ts uses Playwright's
_electron.launch() to boot the real skeleton (dist-electron/main.js from
step 1) and asserts:
  - the login screen renders (same input[type="text"]/[type="password"]
    selectors as e2e/login.spec.ts's browser-based check)
  - zero uncaught page errors fire during load

Sets JMAP_SERVER_URL (any non-empty value) so the app reaches
lib/setup/state.ts's "env-managed" state and serves the normal login screen
instead of 302ing to the first-run /setup wizard - no live mail server or
mock JMAP build flag needed just to prove the shell renders.

playwright.electron.config.ts is deliberately separate from
playwright.config.ts: it has no `webServer` block, since this suite's app
boots its own server and would otherwise race pointlessly with `npm run dev`
starting on :3000 for the browser-based e2e/*.spec.ts suite.

Wired as `npm run test:electron`. Verified green locally (2 passed) after
`npm run build:standalone && npm run build:electron`; every later step in
the Electron rollout must keep this passing before moving on.
2026-08-04 12:45:42 +02:00

22 lines
890 B
TypeScript

import { defineConfig } from '@playwright/test';
// Separate from playwright.config.ts on purpose: the Electron smoke suite
// launches its own app (which boots its own standalone Next.js server via
// electron/main.ts - see scripts/build-electron.mjs), so it must NOT inherit
// the main config's `webServer` (which starts `npm run dev` on :3000 for the
// browser-based e2e/*.spec.ts suite) - the two would fight over nothing but
// still waste time starting a server this suite never touches.
export default defineConfig({
testDir: './e2e',
testMatch: 'electron-smoke.spec.ts',
timeout: 60000,
retries: 0,
use: {
trace: 'retain-on-failure',
},
// Electron tests drive their own app windows via the `_electron` fixture,
// not a browser project - one worker keeps main-process/server startup
// logs and any zombie processes easy to reason about.
workers: 1,
});