Skills for building AEM Edge Delivery Services sites — block development, content modeling, code review, testing, and page import.
82
76%
Does it follow best practices?
Impact
88%
1.04xAverage score across 6 eval scenarios
Advisory
Suggest reviewing before use
This skill guides you through testing code changes in AEM Edge Delivery Services projects. Testing follows a value-versus-cost philosophy: create and maintain tests when the value they bring exceeds the cost of creation and maintenance.
CRITICAL: Browser validation is MANDATORY. You cannot complete this skill without providing proof of functional testing in a real browser environment.
Use this skill:
This skill is typically invoked by the building-blocks skill during Step 5 (Test Implementation).
Track your progress:
Run linting first to catch code quality issues:
npm run lintIf linting fails:
npm run lint:fixManually fix remaining issues that auto-fix couldn't handle.
Success criteria:
Mark complete when: npm run lint passes with no errors
CRITICAL: You must test in a real browser and provide proof.
Load test content URL(s) in browser and validate:
Choose the method that makes most sense given your available tools:
Option 1: Browser/Playwright MCP (Recommended)
If you have MCP browser or Playwright tools available, use them directly:
Option 2: Playwright automation
Write one (or more) temporary test scripts to validate functionality with playwright and capture snapshots/screenshots for inspection and validation.
// test-my-block.js (temporary - don't commit)
import { chromium } from 'playwright';
async function test() {
const browser = await chromium.launch({ headless: false });
const page = await browser.newPage();
// Navigate and wait for block
await page.goto('http://localhost:3000/path/to/test');
await page.waitForSelector('.my-block');
// Inspect accessibility tree (useful for validating structure)
const accessibilityTree = await page.accessibility.snapshot();
console.log('Accessibility tree:', JSON.stringify(accessibilityTree, null, 2));
// Optionally save to file for easier analysis
await require('fs').promises.writeFile(
'accessibility-tree.json',
JSON.stringify(accessibilityTree, null, 2)
);
// Test viewports and take screenshots
await page.setViewportSize({ width: 375, height: 667 });
await page.screenshot({ path: 'mobile.png', fullPage: true });
await page.locator('.my-block').screenshot({ path: 'mobile-block.png' });
await page.setViewportSize({ width: 768, height: 1024 });
await page.screenshot({ path: 'tablet.png', fullPage: true });
await page.locator('.my-block').screenshot({ path: 'tablet-block.png' });
await page.setViewportSize({ width: 1200, height: 800 });
await page.screenshot({ path: 'desktop.png', fullPage: true });
await page.locator('.my-block').screenshot({ path: 'desktop-block.png' });
// Check for console errors
page.on('console', msg => console.log('Browser:', msg.text()));
await browser.close();
}
test().catch(console.error);Run: node test-my-block.js then delete the script and analyze the resulting artifacts.
Option 3: Manual browser testing
Use a standard web browser with dev tools:
http://localhost:3000/path/to/test/contentIf acceptance criteria provided (from CDD Step 2):
If design/mockup screenshots provided:
You must provide:
Success criteria:
Mark complete when: Browser testing complete with screenshots as proof
Determine if unit tests are needed for this change.
Write unit tests when:
Skip unit tests when:
For guidance on what to test: See resources/testing-philosophy.md
If unit tests needed:
# Verify test setup (see resources/vitest-setup.md if not configured)
npm test
# Write test for utility function
# test/utils/my-utility.test.js
import { describe, it, expect } from 'vitest';
import { myUtility } from '../../scripts/utils/my-utility.js';
describe('myUtility', () => {
it('should transform input correctly', () => {
expect(myUtility('input')).toBe('OUTPUT');
});
});For detailed unit testing guidance: See resources/unit-testing.md
Success criteria:
npm testMark complete when: Unit tests written and passing, or determined not needed
Verify your changes don't break existing functionality:
npm testIf tests fail:
npm test -- path/to/test.jsSuccess criteria:
Mark complete when: npm test passes with no failures
For detailed troubleshooting guide, see resources/troubleshooting.md.
Common issues:
npm test -- path/to/test.jsnpm run lint:fixaem up --html-folder draftsdrafts/tmp//tmp/ path: http://localhost:3000/drafts/tmp/my-blockawait page.waitForSelector('.block')resources/unit-testing.md - Complete guide to writing and maintaining unit testsresources/troubleshooting.md - Solutions to common testing issuesresources/vitest-setup.md - One-time configuration guideresources/testing-philosophy.md - Guide on what and how to testThe building-blocks skill invokes this skill during Step 5 (Test Implementation).
Inputs received from building-blocks:
Expected outputs to return to building-blocks:
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
skills
analyze-and-plan
block-collection-and-party
block-inventory
building-blocks
code-review
content-driven-development
content-modeling
docs-search
find-test-content
generate-import-html
identify-page-structure
page-decomposition
page-import
preview-import
scrape-webpage
testing-blocks