Apply the #109 review panel: fork guard, loopback dev server, real authenticated assertions.
Tests / unit (pull_request) Successful in 17s
Tests / e2e (pull_request) Failing after 1m1s

Playwright's webServer replaces the custom globalSetup. The e2e job is gated to same-repo PRs because a fork PR controls both the test files and the workflow steps while the E2E_PASSWORD secret is in the environment. The dev server is pinned to loopback, the login screen is asserted before filling, the authenticated state is proven by a token-authenticated request, the token value is never printed, the failed-login test no longer asserts a tautological exitCode, and the DevTools window is no longer mistaken for the app window.
This commit is contained in:
2026-11-03 11:04:18 +11:00
parent 348e47dbd8
commit fcbf1020e8
6 changed files with 69 additions and 82 deletions
+12 -3
View File
@@ -4,10 +4,19 @@ 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,
outputDir: 'test-results',
reporter: [['list'], ['html', { open: false }]],
globalSetup: './tests/e2e/dev-server.mjs',
// The suite logs in to a live homeserver, where Synapse login rate limiting is a real flake.
retries: process.env.CI ? 1 : 0,
reporter: [['list'], ['html']],
// 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',
},
});