Drop the pageerror assertion: the failed login path produces one. (#109)
Tests / unit (pull_request) Successful in 17s
Tests / e2e (pull_request) Successful in 3m53s

This commit is contained in:
2026-11-03 13:01:29 +11:00
parent d12ce65ac5
commit 347acd0ebd
+5 -10
View File
@@ -10,7 +10,6 @@ const PASSWORD = process.env.E2E_PASSWORD;
let app;
let page;
let logs = [];
let pageErrors = [];
let profile;
// ServerPicker gives its input no name or test id, so position is the only handle on it;
@@ -44,7 +43,6 @@ async function submitLogin(username, password) {
test.beforeEach(async () => {
logs = [];
pageErrors = [];
if (!PASSWORD) {
throw new Error('E2E_PASSWORD is not set. Export it, or add it as the CI secret.');
@@ -64,10 +62,7 @@ test.beforeEach(async () => {
?? await new Promise((resolve) => app.once('window', resolve));
}
page.on('console', (msg) => logs.push(`[renderer] ${msg.type()}: ${msg.text()}`));
page.on('pageerror', (err) => {
pageErrors.push(String(err));
logs.push(`[renderer] pageerror: ${err}`);
});
page.on('pageerror', (err) => logs.push(`[renderer] pageerror: ${err}`));
await chooseServer(HOMESERVER);
});
@@ -128,9 +123,9 @@ test('failed login reports an error without crashing the app', async () => {
await expect(page.getByText('Invalid Username or Password.')).toBeVisible();
// "Without crashing" needs a liveness signal: no uncaught renderer error, form still usable.
// No second login here: every run costs Synapse rc_login budget, and the re-login was the
// main source of flakes.
await expect(pageErrors).toHaveLength(0);
// "Without crashing" is proven by the form still rendering: a dead renderer cannot render it.
// Pageerrors go into the artifact but are not asserted — the failed login itself produces
// MatrixError, and dev mode produces a ServiceWorker registration error. No second login
// here: every run costs Synapse rc_login budget, and the re-login was the main flake source.
await expect(usernameInput()).toBeVisible();
});