Testing Blocks

Automate testing of AEM Edge Delivery code changes with unit, browser, and lint checks.

3|3|Updated Jun 3, 2025
One-click install
npx skills add https://github.com/aemsites/da-blog-tools --skill testing-blocks-aemsites
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: Testing Blocks
Source: https://github.com/aemsites/da-blog-tools/tree/main/.claude/skills/testing-blocks
Command: npx skills add https://github.com/aemsites/da-blog-tools --skill testing-blocks-aemsites

SYSTEM DOCUMENTATION & REQUIREMENTS

๐Ÿ’ก This Skill includes references (resource) components.

What problem does it solve?

Manual testing is error-prone and time-consuming, leading to regressions and delayed releases. This Skill provides a comprehensive guide and workflow for testing AEM Edge Delivery Services code changes, ensuring quality, performance, and adherence to best practices before any pull request.

Core Features & Use Cases

  • Comprehensive Testing Workflow: Guides through unit testing for logic, browser testing for UI, linting for code quality, and performance validation.
  • Value-vs-Cost Philosophy: Distinguishes between "keeper" tests (unit tests for critical logic) and "throwaway" tests (browser tests for visual validation), optimizing testing effort.
  • Use Case: After implementing a new "Carousel" block, use this Skill to ensure all variants render correctly, responsive behavior is sound, linting passes, and performance metrics are met, providing confidence for PR submission.

Quick Start

Use the "Testing Blocks" skill to get guidance on how to write a throwaway browser test for the "hero" block.

Frequently Asked Questions about Testing Blocks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test AEM Edge Delivery blocks before submitting a pull request?โ–ผ

Testing AEM blocks involves running unit tests for logic, browser tests with Playwright or Puppeteer for UI validation, linting for code quality, and performance checks. This Skill guides you through a comprehensive workflow covering keeper tests for critical functionality and throwaway tests for visual verification, ensuring quality before PR submission.

What's the difference between unit tests and browser tests for AEM blocks?โ–ผ

Unit tests validate core logic and are kept long-term; browser tests verify UI rendering and responsive behavior but are temporary. Unit tests catch functional regressions efficiently; browser tests catch visual issues. This Skill teaches when to write each type, optimizing testing effort and preventing false confidence.

How do I set up linting and performance validation in an AEM Edge Delivery project?โ–ผ

Linting checks code quality against standards; performance validation measures metrics. This Skill covers configuring both as npm script hooks integrated into CI pipelines, ensuring code adheres to best practices and meets performance requirements automatically before deployment.

Can I automate testing for multiple AEM blocks across content-driven workflows?โ–ผ

Yes. This Skill provides guidance on test organization, naming conventions, and npm script hooks that scale across blocks, scripts, styles, and configuration changes. Automation integrates with CI pipelines, reducing manual effort and ensuring consistent validation across your entire Edge Delivery project.

What should I test in a new AEM block to ensure it's production-ready?โ–ผ

Test all variants for correct rendering, responsive behavior across devices, linting compliance, and performance metrics. This Skill walks through validating a new block like a Carousel or Hero component, covering functional correctness, visual integrity, code quality, and performance before PR submission.

Do I need specific tools like Playwright or Puppeteer to test AEM blocks?โ–ผ

Browser testing for AEM blocks uses Playwright or Puppeteer to automate UI validation. This Skill explains when throwaway browser tests are worth the overhead and provides guidance on setting them up within your testing workflow alongside unit tests and linting.