testing-blocks
БесплатноБез исполняемых скриптовНе проверенUse before writing unit or Playwright E2E tests for an AEM Edge Delivery Services block or script, when deciding what tests a block change needs, or when…
от adobe★ 342 звезды на GitHubОб этом скилле
Testing Blocks
Validate code changes and write maintainable tests in AEM Edge Delivery Services projects.
Related Skills
- content-driven-development: test content created during CDD is what you validate against
- aem-cli: running
aem up(ports in git worktrees, serving./content/, cleaning up stale./content/files that shadow remote.aem.pageupdates)
Testing Workflow
- Step 1: Run linting and fix issues
- Step 2: Validate in a browser (MANDATORY when validating a code change)
- Step 3: Decide which tests to commit, and write them
- Step 4: Run the project's tests
Step 2: Browser Validation
Exercise the block in a real browser on the test content URL(s): every variant, mobile, tablet and desktop widths (e.g. 375px, 768px, 1200px), and every interaction. Use whatever tooling you have: browser/Playwright MCP tools, a throwaway Playwright script (delete it afterwards), or a manual browser.
Step 3: Committed Tests
Committed tests guard functional behavior so it doesn't silently regress. Write a test only when a wrong answer is plausible and costly to miss. 100% coverage is not the goal, and neither is a test per variant or per branch; a block with static decoration and no behavior may need no tests at all.
Use the project's test tools. Find them in package.json scripts, test config and existing tests, and follow their file locations and naming. Don't add a second framework. aem-boilerplate ships without one; if the project has no test setup, ask the user before adding one.
Browser (E2E) tests assert the block's functional behavior. Rules for E2E specs:
- Run them against the block's library page (the canonical example content). It is author-facing reference content and the happy path: don't add rows to it to drive a test. Cover edge cases in unit tests or on a separate drafts page (e.g.
./content/drafts/). - Locate elements by role and accessible name. Don't use classes or ids the block's own
decorate()adds, or hardcoded authored copy; when you need a label, read it from the page at runtime. The block root class (.{block}) comes fromaem.jsand is stable. - Assert behavior, not visuals: no computed CSS (
toHaveCSS,getComputedStyle), geometry (boundingBox), or screenshot comparisons (toHaveScreenshot).
Step 4: Run the Project's Tests
If package.json defines test scripts (the boilerplate has none), run them, including any new tests. E2E suites usually need the dev server (aem up) running.
Troubleshooting
Browser tests fail
- Verify
aem upis running and check the port it logged (in a git worktreeaem upuses a branch-hashed port, not 3000; see aem-cli). - Local test pages belong under
./content/(e.g.content/drafts/my-block.htmlserved at/drafts/my-blockwith no--html-folderflag). If testing a remote.aem.pageupdate, make sure a stale file in./content/isn't shadowing that path.
Установить testing-blocks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл testing-blocks?
Use before writing unit or Playwright E2E tests for an AEM Edge Delivery Services block or script, when deciding what tests a block change needs, or when validating block, script or style changes in a browser before a pull request. EDS block testing has non-obvious conventions (how to locate elements without breaking on author edits, library page vs drafts, analytics assertions, no-framework-addition rule, and waiting on decoration), so check here first. Not for implementing block code (building-blocks) or PR review comments (code-review).
Как установить скилл testing-blocks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл testing-blocks запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic