Skip to content
Back to skills

E2e

ASecurity

End-to-end tests of a game with Playwright (apps/*/e2e/*.e2e.ts) on a WebGL canvas, and taking screenshots of the running game. Load before writing or debugging an e2e test, or to look at the game in a browser.

  • 35 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 7, 2026
developmentdebugginggit

Works with

  • cli

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add ltruchot/seed-pixi-typescript --skill e2e --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of E2e?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for E2e
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ltruchot-e2e/badge)](https://www.skillsdirectory.com/skills/ltruchot-e2e)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: e2e
description: End-to-end tests of a game with Playwright (apps/*/e2e/*.e2e.ts) on a WebGL canvas, and taking screenshots of the running game. Load before writing or debugging an e2e test, or to look at the game in a browser.
globs:
  - "apps/*/e2e/**"
---

# e2e on a canvas

`apps/game/e2e/playwright.config.ts`: Chromium, `webServer` = `vp preview` (port 8081) on the
**build**. So: `vp -C apps/game build && vp -C apps/game run e2e` (the `ready` script does both).
Results and traces: `.local/test-results/` (gitignored). Chromium once per machine:
`vp -C apps/game exec playwright install chromium` (CI: `--with-deps`).

## No false green

A canvas has no DOM to query: "the canvas is visible" passes on a black screen. Assert on
pixels, and prove the test can fail:

- Compare `page.screenshot({ clip })` buffers. `game.e2e.ts`: the center square differs from a
  background-only corner (the hero is drawn), then after holding `ArrowRight` it equals it
  (the hero left). Wait with `expect.poll`, never a fixed delay before the first assertion.
- Collect `pageerror` and `console` errors for the whole test; assert `[]` at the end.
- After writing a test, break the game on purpose (e.g. speed 0), rebuild, see it fail, revert.

## Traps

| Symptom                                                         | Cause                                                       | Fix                                                 |
| --------------------------------------------------------------- | ----------------------------------------------------------- | --------------------------------------------------- |
| Lint `no-conditional-in-test` on an `if` in a `page.on` handler | any condition inside `test()`                               | a module-level helper (`collectErrors(page)`)       |
| `require-await` on `expect.poll(async () => helper())`          | the arrow only returns a promise                            | `expect.poll(() => helper())`                       |
| The test sees the old game                                      | e2e runs on `dist/`, not the dev server                     | `vp -C apps/game build` first                       |
| `Port 8081 is already in use`                                   | a `vp preview` left running (locally `reuseExistingServer`) | stop it by PID, skill `vp` ("Dev server under WSL") |
| "BEWARE: your OS is not officially supported by Playwright"     | WSL distro newer than Playwright's list                     | harmless: the ubuntu24.04 build runs                |

## Just looking at the game

Take a screenshot to see a visual change: a one-off test in `e2e/` that calls
`page.screenshot({ path: "../../.local/screenshots/x.png" })`, run it, read the PNG, delete
the test.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.