Skip to content
AI & Agents
Skill

/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

From plugin
skills
333183 skills5 MCP

Claude Code

$ npx -y skills add adobe/skills --skill testing-blocks --agent claude-code

SKILL.md

testing-blocks.SKILL.md
name: testing-blocks
description: "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)."
license: Apache-2.0
metadata:
  version: "2.0.4"

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.page` updates)

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 from `aem.js` and 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 up` is running and check the port it logged (in a git worktree `aem up` uses a branch-hashed port, not 3000; see **aem-cli**).
  • Local test pages belong under `./content/` (e.g. `content/drafts/my-block.html` served at `/drafts/my-block` with no `--html-folder` flag). If testing a remote `.aem.page` update, make sure a stale file in `./content/` isn't shadowing that path.
Read more
@adobe
Ships withskills

Skills that teach AI coding agents to work with Adobe products. A skill is a folder with a SKILL.md that an agent loads when a task calls for it (agentskills.io).

333183 skills5 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
333
Star history of adobe/skills on GitHub, a chart by star-history.com

Other skills on skills.

aa-conversion-funnel-analysis

aa-conversion-funnel-a…

Analyzes a multi-step conversion funnel to find where visitors drop off and which steps have the worst leakage. Use this skill…

@adobe@adobeInstall Skill
aa-executive-briefing

aa-executive-briefing

Generates a concise, executive-ready performance summary covering key metrics, trends, and what's driving movement. Use this…

@adobe@adobeInstall Skill
aa-kpi-pulse

aa-kpi-pulse

Produces a compact KPI digest showing how key metrics changed over a period and what's driving the movement. Use this skill when…

@adobe@adobeInstall Skill
aa-top-movers-watchlist

aa-top-movers-watchlis…

Identifies which items (pages, campaigns, products, channels, regions) had the biggest increases or decreases for a key metric…

@adobe@adobeInstall Skill
cja-dimension-analysis

cja-dimension-analysis

Comprehensive dimension analysis and reporting for CJA. Use this skill whenever the user wants to analyze one or more dimensions…

@adobe@adobeInstall Skill

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

openclaw3w393k
@openclaw@openclawInstall Skill

Questions about testing-blocks.

Which coding agents can use testing-blocks?
testing-blocks installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.