Files
cinny-desktop/playwright.config.mjs
T
litruv 1ddca42473
Tests / unit (pull_request) Successful in 17s
Tests / e2e (pull_request) Successful in 4m10s
Apply the #109 re-review: crash assertion, artifact hook on launch failure, dropped redundant lines. (#109)
tests/e2e/login.spec.mjs: assert the render process is alive with the `crash`
event instead of counting pageerrors; the failed-login test now accepts the
rate-limited message as well as the wrong-password one; the failure hook
attaches the console before the app guard so a launch failure still produces an
artifact, wraps `screenshot()` because it throws on a crashed page, and reaches
`fs.rmSync` on launch failure; dropped the duplicate login-form assertion.

playwright.config.mjs: pin `trace: 'off'` explicitly rather than relying on the
version default, since a trace captures the login POST body.

.gitea/workflows/tests.yml: dropped `--prefer-offline`; corrected the xvfb
comment (the guard is live for the host runner, which already has xvfb); dropped
an unresolvable CI run-number citation.

Checks: `node --check` on both JS files, `npm run test:unit` — 2 passed. E2E
cannot be run locally (no `E2E_PASSWORD` in this session); CI is the check.
2026-11-03 13:22:39 +11:00

27 lines
1.2 KiB
JavaScript

import { defineConfig } from '@playwright/test';
export default defineConfig({
testDir: './tests/e2e',
// Electron launch plus first paint is far slower than a page load.
timeout: 120_000,
expect: { timeout: 30_000 },
// One Electron process at a time: the app takes a single-instance lock and
// every test shares the same vite dev server.
workers: 1,
// The suite logs in to a live homeserver, where Synapse login rate limiting is a real flake.
retries: process.env.CI ? 1 : 0,
// An explicit reporter replaces the default, so list stays for the CI log.
reporter: [['list'], ['html']],
// A trace captures the login POST body, which contains the password. Pin it off rather than
// relying on the version default.
trace: 'off',
// cinny/vite.config.js binds 0.0.0.0 with fs.allow: ['..'], which is exposed on a shared
// CI runner, so pin the dev server to loopback. The flag has to reach vite itself:
// `npm run dev:vite -- --host` lands on sh's positional params, not on vite.
// localhost is also the URL electron/main.js loads, so the page keeps that origin.
webServer: {
command: 'sh -c "cd cinny && npm start -- --host localhost"',
url: 'http://localhost:38347',
},
});