Vetrix Docs

FE Playwright CI — full-stack target

This doc is the source of truth for what live stack the frontend Playwright CI jobs run against.

Background

Six a11y / E2E Playwright jobs run in vetrix-frontend/vetrix-ci.yml. Four of them (web-a11y-e2e, repositories-landing-responsive, security-scannerfix-cross-browser, slow-chromium-e2e) drive a real browser against a running product and therefore need a live web + api + postgres stack.

vetrix-frontend has no docker-compose.yml, and its Dockerfile (vetrix-frontend repo root) builds only the web service — there is no api or postgres source in this repo to compose. The stack-dependent jobs therefore target the shared dev-stack at https://www.gitvetrix.test and do not bring up a stack per job.

Target: the shared dev-stack

The Playwright jobs run against the already-running dev-stack at https://www.gitvetrix.test via the E2E_BASE_URL toggle. No docker-compose.yml is added to vetrix-frontend.

  • It is the wired path. playwright.config.ts (vetrix-frontend repo root) resolves its baseURL from E2E_BASE_URL (falling back to the local http://localhost:3001 dev server only when the variable is unset), and the stack-dependent jobs export E2E_BASE_URL=https://www.gitvetrix.test. The E2E specs themselves reference the dev-stack and its bootstrap-seeded super-admin credentials (admin / a development seed fixture password — see § Credentials below). The target is provided purely by the env var the jobs set — no changes to specs or config are needed.

  • A frontend-only repo cannot compose a backend. This repo can build web but not api/postgres. An in-repo compose file would have to pull a pre-built, externally published backend image, coupling the FE pipeline to backend image publishing and version drift — strictly more brittle than pointing at a stack that is already stood up and migrated.

Accepted trade-off: dev-stack availability

The cost of targeting the shared dev-stack is that CI is coupled to dev-stack availability — if https://www.gitvetrix.test is down or mid-redeploy, the stack-dependent jobs fail through no fault of the code under test.

This is the same coupling the backend lives with, and the mitigation is the same: the long-running, most-exposed job (slow-chromium-e2e) is non-blocking via the native allow_failure: true per-job key (allow_failure: <bool> is a first-class v1 schema key). The real Playwright exit code propagates: a red suite reports the job failed (soft) at the pipeline summary / commit-status surface (the soft_failed projection) while the pipeline still completes. The firefox lane (slow-firefox-e2e) carries the same allow_failure: true key. There is no SOFT_FAIL variable anywhere in vetrix-ci.yml; a build guard under src/__tests__/build/ enforces that.

Enforcing flip: delete the allow_failure: true line from the job in vetrix-ci.yml (vetrix-frontend repo root) — that single deletion makes a red suite fail the pipeline.

Setting the target in a job

The stack target is provided entirely through the E2E_BASE_URL environment variable — there is nothing to bring up. For each stack-dependent job, set:

variables:
  E2E_BASE_URL: "https://www.gitvetrix.test"

and run Playwright at the repo root (no cd web):

commands:
  - npm ci
  - npx playwright install --with-deps chromium
  - npx playwright test --project=chromium   # or the job's project / grep

playwright.config.ts reads E2E_BASE_URL for baseURL. Because the target is a remote host, the config's local webServer stanza is not exercised in CI (it only spins up npm run dev when Playwright is pointed at localhost).

Credentials

Do not hardcode login credentials in the YAML — and this page does not either. The dev-stack super-admin username is admin; its password is a development seed fixture, not a live credential, seeded by the dev-stack bootstrap and read by the specs from src/__tests__/e2e/_helpers.ts (vetrix-frontend repo) — that is the one place to look up the value, not this page. Where a job needs to inject credentials, source them from a runner secret binding with secret: true, never plaintext, per authoring-vetrix-pipelines.md § Variables, interpolation & secrets.

Cross-references

  • playwright.config.ts (vetrix-frontend repo root) — E2E_BASE_URL toggle.
  • The a11y-gate runbook (now in runbook-docs) describes the backend docker compose up web api postgres bring-up that this target supersedes for the FE repo.