write-e2e-tests — Claude Code skill for E2E tests
Guides Playwright E2E testing for tldraw, including UI actions, menus, and canvas shapes. Use it when adding coverage for SDK examples or the tldraw.com client.
npx skills add tldraw/tldraw --skill write-e2e-tests -a claude-codeWhat write-e2e-tests does
This skill guides Playwright E2E work for tldraw in apps/examples/e2e/ and apps/dotcom/client/e2e/. It covers the test-<feature>.spec.ts naming pattern, fixture imports, and state preparation with setupOrReset.
It uses page.evaluate() for editor actions and points to getByTestId() or toolbar fixtures for UI controls. The guidance also covers menus, UI-event checks, data-driven cases, and differences between Mac systems and mobile viewports.
Test runs include pnpm e2e, pnpm e2e-dotcom, and pnpm e2e-ui. A shared page is only suitable where full test isolation is unnecessary, so dependent checks need scrutiny.
What it helps with
- add a Playwright test for a drawing tool
- verify selected shapes on the canvas
- activate an item in a main or context menu
- check a UI event after a keyboard action
- handle modifier keys on Mac and mobile cases
Example prompts for the agent
- Add an E2E test for a new tool under `apps/examples/e2e/tests/` using `setupOrReset`.
- Check with Playwright that selecting a rectangle updates the toolbar button state.
- Write a context-menu test and assert the UI event after a key press.
How to install write-e2e-tests
1Skills CLI (Vercel)
npx skills add tldraw/tldraw --skill write-e2e-tests -a claude-code2Manually: put the files in place
~/.claude/skills/write-e2e-tests/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/write-e2e-tests/
1Skills CLI (Vercel)
npx skills add tldraw/tldraw --skill write-e2e-tests -a codex2Manually: put the files in place
.agents/skills/write-e2e-tests/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add tldraw/tldraw --skill write-e2e-tests -a cursor2Manually: put the files in place
.cursor/skills/write-e2e-tests/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install tldraw/tldraw write-e2e-tests2Manually: put the files in place
.github/skills/write-e2e-tests/SKILL.md1Skills CLI (Vercel)
npx skills add tldraw/tldraw --skill write-e2e-tests -a gemini-cli2Platform CLI
gemini skills install https://github.com/tldraw/tldraw --path skills/write-e2e-testsManually: put the files in place
.devin/skills/write-e2e-tests/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add tldraw/tldraw --skill write-e2e-tests -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set7
The whole set →Similar
Questions about write-e2e-tests
How do I install write-e2e-tests in Claude Code?
Run npx skills add tldraw/tldraw --skill write-e2e-tests -a claude-code, then run npx skills add tldraw/tldraw --skill write-e2e-tests -a claude-code again. The skill file is at ~/.claude/skills/write-e2e-tests/SKILL.md.
What does write-e2e-tests do?
It guides Playwright E2E tests for tldraw. The skill covers fixtures, canvas interaction, menus, UI events, and state assertions.
What is needed to use editor in page.evaluate()?
Import Editor from tldraw and declare editor. UI-event checks also require a declaration for __tldraw_ui_event.