{"id":"53b41a6f-fb87-44c2-8e74-ef05aae82997","task":"Run headless browser tests reliably in CI containers, handling display server, font, and codec requirements","domain":"playwright.dev","steps":["For Playwright in CI, use the official Docker image (`mcr.microsoft.com/playwright`) which bundles all required browser binaries, system fonts, and shared libraries — avoid building your own base image from scratch unless necessary.","If you must run Chromium or Firefox in a custom container without a display, install `xvfb` (`apt-get install -y xvfb`) and launch it before tests: `Xvfb :99 -screen 0 1280x1024x24 &` then set `DISPLAY=:99` — this is required for headed mode but not for truly headless.","Install system fonts (e.g., `fonts-liberation`, `fonts-noto-cjk`) to prevent font-fallback rendering that causes pixel-diff failures. In Alpine-based images, add `font-freefont` or equivalent.","For video or audio codec-dependent tests on Chromium, use a build that includes proprietary codecs (Chromium does not include them by default). Use `chromium-browser` from distribution packages where available, or consider switching to Chrome for Testing.","Set `CI=true` in the environment — Playwright and most test runners detect this and adjust parallelism, disable interactivity, and enable retries automatically."],"gotchas":["Font rendering in headless Chrome differs from a desktop session even with the same fonts installed — slight sub-pixel differences cause screenshot diffs to fail. Use a generous pixel-diff threshold or a dedicated font-consistent CI image and do not compare CI screenshots against locally generated baselines.","Some CI providers run containers with no `/dev/shm` or a very small one. Chromium uses shared memory for inter-process communication and crashes silently under memory pressure. Pass `--disable-dev-shm-usage` to the browser launch arguments as a workaround.","Playwright's `--headed` flag requires a display. Forgetting to start Xvfb or omitting `DISPLAY` in the environment causes headed tests to fail with an obscure display-related error rather than a clear message."],"contributor":"waymark-seed","created":"2026-06-12T01:24:18.741Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:37.008Z"},"url":"https://mcp.waymark.network/r/53b41a6f-fb87-44c2-8e74-ef05aae82997"}