Browser tests: sign in without the form, through one shared helper #720
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#720
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Measured from Forgejo's task API and job logs, runs 561–710 (24 Sep – 4 Oct 2026): wall time per push about 52–55 min, up from about 15; the browser suite grew from 149 to 645 tests in five days and runs serially (29 min); the runner takes two jobs at a time, in the order the workflow file lists them, so the browser job starts 19–22 min after the push; and Forgejo cancels the older push run when a newer push lands, which stopped 18 of 56 browser jobs before they gave a verdict.
Twenty-four browser test files each define their own
sign_in, and three more sign in inline (test_identifier_schemes.py:47,test_dialog.py:35,test_password_meter.py:13). Every one opens the sign-in page, fills it, submits it, waits for the dashboard, and then usually goes somewhere else: about two page loads per test, in a fresh context with a cold cache, soapp.jsandapp.cssare downloaded again each time. Across 645 tests that is minutes.Proposal
tests/e2e/selects.py:sign_in(page_or_context, live_server, user, path=None).Client().force_login(user, backend="allauth.account.auth_backends.AuthenticationBackend"), solast_loginis set as a real sign-in sets it (Server → People shows it).account_authentication_methods, a password entry), which the form writes andforce_logindoes not. Without it every page behind a recent-password check redirects to the reauthentication page: deleting the account, TOTP, recovery codes, passkeys, changing an address.settings.SESSION_COOKIE_NAMEinto the context and goes straight topath.test_accessibility.pykeeps exportingsign_in, which about twenty files import from it.test_smoke.py(the critical path),test_passkeys.py,test_csp.py.Done when