Token导航 LogoToken导航

Agent Skill · 研究检索

testing-blocks(测试块)

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

testing-blocks 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 10,021。

总安装 13,219周安装 389GitHub Stars 40下载 5,480核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:testing-blocks(测试块)
来源仓库:https://github.com/adobe/helix-website
仓库路径:skills/testing-blocks
安装命令:
npx skills add https://github.com/adobe/helix-website --skill 'Testing Blocks'
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/adobe/helix-website --skill 'Testing Blocks'

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

AEM Edge Delivery 中的测试遵循务实的价值与成本方法: 创建 keeper 测试: 逻辑密集型实用程序 数据处理和转换 API集成 共享库 使用一次性浏览器测试: 块装饰验证 视觉外观 DOM结构 互动行为 总是这样做: 在提交之前运行 linting 在浏览器中手动测试 验证 GitHub 检查是否通过 在 PR 中包含测试链接 请记住:目标是确保您的代码正确运行,而不是实现 100% 的测试覆盖率。

编写提供价值的测试,并验证浏览器中的其他所有内容。每周安装量 – 存储库 adobe/helix-网站 GitHub 之星 40 第一次看到 – 安全审计 Gen Agent Trust Hub 通行证 套接字通行证 斯尼克警告

来源仓库内路径:skills/testing-blocks

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/adobe/helix-website --skill 'Testing Blocks';命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

testing-blocks 怎么安装?

在终端执行 npx skills add https://github.com/adobe/helix-website --skill 'Testing Blocks'。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

testing-blocks 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

testing-blocks 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

testing-blocks 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

testing-blocks 用的人多吗?

公开数据是累计安装 13,219 次,近一周安装 389 次,下载 5,480 次,GitHub 40 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

testing-blocks 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
testing-blocks

测试块 · 本页

13,21940操作浏览器未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Testing Blocks

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.

Related Skills

  • content-driven-development: Test content created during CDD serves as the basis for testing
  • building-blocks: This skill is automatically invoked after block implementation
  • block-collection-and-party: May provide reference test patterns from similar blocks

When to Use This Skill

Use this skill:

  • ✅ After implementing or modifying blocks
  • ✅ After changes to core scripts (scripts.js, delayed.js, aem.js)
  • ✅ After style changes (styles.css, lazy-styles.css)
  • ✅ After configuration changes that affect functionality
  • ✅ Before opening any pull request with code changes

This skill should be automatically invoked by the building-blocks skill after implementation is complete.

Testing Philosophy: Value vs Cost

The Principle: Create and maintain tests when the value they bring exceeds the cost of creation and maintenance.

Keeper Tests (High Value, Worth Maintaining)

✅ Write unit tests for:

  • Logic-heavy utility functions used across multiple blocks
  • Data processing and transformation logic
  • API integrations and external service interactions
  • Complex algorithms or business logic
  • Shared libraries and helper functions

These tests provide lasting value because they catch regressions in reused code, serve as living documentation, and are fast and easy to maintain.

Throwaway Tests (Lower Value, Use Once)

⚠️ Use browser tests for:

  • Block decoration logic (DOM transformations)
  • Specific DOM structures or UI layouts
  • Visual appearance validation
  • Block-specific rendering behavior

These tests are better done in a browser because DOM structures change frequently, visual validation requires human judgment, and maintaining UI tests is expensive relative to their value.

Important: Even throwaway tests have value! Use them to:

  1. Validate your implementation works correctly
  2. Take screenshots to evaluate visual correctness
  3. Show screenshots to humans for feedback
  4. Include screenshots in PRs to aid review

Organization: Keep throwaway tests in test/tmp/ and test content in drafts/tmp/. Both directories should be gitignored so temporary test artifacts aren't committed.

Testing Checklist

Before opening a pull request, complete ALL of the following:

  • Existing tests pass - All keeper tests still pass with your changes
  • Unit tests written - New keeper tests for any logic-heavy utilities or data processing
  • Browser validation - Feature tested in local dev server, screenshots captured
  • All variants tested - Each variant/configuration of blocks validated
  • Responsive behavior - Tested on mobile, tablet, desktop viewports
  • Linting passes - npm run lint completes without errors
  • Branch pushed - Code committed and pushed to feature branch
  • GitHub checks verified - Use gh checks to confirm all CI checks pass

Testing Methods Overview

1. Unit Tests (KEEPER TESTS)

When to use: Logic-heavy functions, utilities, data processing, API integrations

Quick start:

# 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');
  });
});

# Run tests during development
npm run test:watch

Detailed guide: See resources/unit-testing.md

2. Browser Testing (THROWAWAY TESTS)

When to use: Block decoration, visual validation, DOM structure, responsive design

Organization:

  • Test scripts: test/tmp/test-{block}-browser.js
  • Test content: drafts/tmp/{block}.html
  • Screenshots: test/tmp/screenshots/
  • Both test/tmp/ and drafts/tmp/ should be gitignored

Quick start:

# Install Playwright
npm install --save-dev playwright
npx playwright install chromium

# Create test content
# drafts/tmp/my-block.html (copy head.html content, add test markup)

# Start dev server with drafts folder
aem up --html-folder drafts

# Create throwaway test script in test/tmp/
# test/tmp/test-my-block.js
import { chromium } from 'playwright';
import { mkdir } from 'fs/promises';

async function test() {
  await mkdir('./test/tmp/screenshots', { recursive: true });
  const browser = await chromium.launch({ headless: false });
  const page = await browser.newPage();

  await page.goto('http://localhost:3000/drafts/tmp/my-block');
  await page.waitForSelector('.my-block');
  await page.screenshot({
    path: './test/tmp/screenshots/my-block.png',
    fullPage: true
  });

  await browser.close();
}

test().catch(console.error);

# Run the test
node test/tmp/test-my-block.js

# Clean up when done (optional - gitignored either way)
rm -rf test/tmp/*

Detailed guide: See resources/browser-testing.md

3. Linting (ALWAYS)

When to use: Before every commit

Quick start:

# Run linting
npm run lint

# Auto-fix issues
npm run lint:fix

Linting MUST pass before opening a PR. Non-negotiable.

4. Performance Testing (AUTOMATED)

When to use: After pushing branch, automatically via GitHub checks

Quick start:

# Push branch
git push -u origin your-branch

# Create PR with test link
# PR description MUST include:
# Preview: https://branch--repo--owner.aem.page/path/to/test

# Monitor checks
gh pr checks --watch

Performance tests run automatically when you include a test link in your PR description.

Complete Workflow

For detailed step-by-step workflow, see resources/testing-workflow.md.

Quick summary:

During Development

  1. Write unit tests for new utilities
  2. Run npm run test:watch
  3. Manually test in browser

Before Committing

  1. Run npm test - all tests pass
  2. Run npm run lint - linting passes
  3. Write throwaway browser test in test/tmp/
  4. Create test content in drafts/tmp/
  5. Review screenshots from test/tmp/screenshots/
  6. Manual validation in browser

Before Opening PR

  1. Commit and push to feature branch (test/tmp/ won't be included)
  2. Verify branch preview loads
  3. Run gh checks
  4. Create PR with test link
  5. Monitor gh pr checks

After PR Review

  1. Address feedback
  2. Re-test
  3. Verify checks pass

Troubleshooting

For detailed troubleshooting guide, see resources/troubleshooting.md.

Common issues:

Tests fail

  • Read error message carefully
  • Run single test: npm test -- path/to/test.js
  • Fix code or update test

Linting fails

  • Run npm run lint:fix
  • Manually fix remaining issues

GitHub checks fail

  • Ensure PR has test link
  • Check gh pr checks for details
  • Fix performance issues if PSI fails

Browser tests fail

  • Verify dev server running: aem up --html-folder drafts
  • Check test content exists in drafts/tmp/
  • Verify URL uses /tmp/ path: http://localhost:3000/drafts/tmp/my-block
  • Add waits: await page.waitForSelector('.block')

Resources

  • Unit Testing: resources/unit-testing.md - Complete guide to writing and maintaining unit tests
  • Browser Testing: resources/browser-testing.md - Playwright/Puppeteer workflows and best practices
  • Testing Workflow: resources/testing-workflow.md - Step-by-step workflow from dev to PR
  • Troubleshooting: resources/troubleshooting.md - Solutions to common testing issues
  • Vitest Setup: resources/vitest-setup.md - One-time configuration guide

Integration with Building Blocks Skill

The building-blocks skill automatically invokes this skill after implementation.

Expected flow:

  1. Building blocks completes implementation
  2. Invokes testing-blocks skill
  3. This skill guides testing process
  4. Returns control when testing complete

Building blocks provides:

  • Block name being tested
  • Test content URL from CDD process
  • Any variants that need testing

This skill returns:

  • Confirmation all tests pass
  • Screenshots from browser testing (if requested)
  • Any issues discovered during testing

Summary

Testing in AEM Edge Delivery follows a pragmatic value-versus-cost approach:

Create keeper tests for:

  • Logic-heavy utilities
  • Data processing and transformations
  • API integrations
  • Shared libraries

Use throwaway browser tests for:

  • Block decoration validation
  • Visual appearance
  • DOM structure
  • Interactive behavior

Always do:

  • Run linting before commits
  • Test manually in browser
  • Verify GitHub checks pass
  • Include test links in PRs

Remember: The goal is confidence that your code works correctly, not achieving 100% test coverage. Write tests that provide value, and validate everything else in a browser.

平台分布

Codex

33.78%
按下载量换算1,851

Claude

33.21%
按下载量换算1,820

Cursor

19.97%
按下载量换算1,094

Gemini CLI

10.21%
按下载量换算560

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills