Playwright tests that drive the real application through Chromium:
tests/authorization.e2e.ts:- Keycloak login redirect
- rejected credentials
401without a token- viewer role is read-only (
403on writes) - sign-out
tests/discovery.e2e.ts:- Git URLs with embedded credentials are refused
- the complete editor flow: repository with credentials (connection check with a wrong and a right password; the password stays write-only on edit and the check reuses it) → interview (with follow-up) → spec generation → approval (the pushed branch is cloned, and its files and five commits are checked) → DAG readiness → dispatch → feature interview
tests/settings.e2e.ts:- an administrator opens Settings from the sidebar, tests and saves Keycloak and the policy agent; a wrong realm or agent URL is refused
- other users see the settings read-only
- a policy refuses a repository on a Git host that is not allowed (
opa-config.jsonallows onlygit-server)
tests/navigation.e2e.ts:- each sidebar section has its own URL, and the back button works
- a bookmarked URL opens the right section after the Keycloak login
sh scripts/run-e2e.shOnly Docker is required. The script builds the backend and frontend images, starts docker-compose.e2e.yml (PostgreSQL, Keycloak with the test-only realm in keycloak/, a Git server, Open Policy Agent with the test values in opa-config.json, a Docker socket proxy, backend and frontend), waits for their health checks, runs Playwright in its official image, and always removes the stack and its volumes. The results go to playwright-report/ (HTML) and test-results/ (traces and screenshots of failures).
To iterate on tests against a running stack:
cd e2e
docker compose -f docker-compose.e2e.yml up -d --build --wait postgres keycloak git-server opa docker-proxy backend frontend
docker compose -f docker-compose.e2e.yml --profile test run --rm --build e2e npx playwright test -g "viewer"
docker compose -f docker-compose.e2e.yml --profile test down -vThe state persists between runs on a running stack. The main flow expects a fresh database and Git server, so run down -v before repeating it.
- Test-only credentials:
e2e-editor/e2e-viewer/e2e-adminexist only inkeycloak/e2e-realm.json. Never import that realm anywhere else. The Git server logine2e-gitand the credential encryption key exist only indocker-compose.e2e.yml. - Docker access: the backend starts Git job containers through a Docker socket proxy, on the fixed network
ojct-e2e.scripts/run-e2e.shfails if any of them is left behind. - Secure context: the browser uses Compose hostnames over HTTP. keycloak-js needs Web Crypto, so
playwright.config.tsruns full Chromium with--unsafely-treat-insecure-origin-as-securefor exactlyhttp://frontend:8080andhttp://keycloak:8080. - Versions: keep
@playwright/testinpackage.jsonequal to the image tag inDockerfile. Renovate groups them.