Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计通过

testing测试

Agent Skill

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

总安装

392

周安装

16

GitHub Stars

4

下载量

127
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/alphaonedev/openclaw-graph --skill testing

简介

testing 用于辅助编写和管理测试用例,覆盖单元、集成与端到端测试层级。

  • 适合在敏捷开发、CI/CD 流水线中提升代码质量与回归验证效率。
  • 支持 TDD/BDD 方法、覆盖率分析与命名规范建议,强化开发流程。
  • 需根据项目框架选择工具链,运行前确认测试环境与依赖配置。
  • 避免为通过测试而修改真实逻辑,确保测试反映实际行为。

SKILL.md

testing

Purpose

This skill enables OpenClaw to assist with comprehensive testing strategies, including the testing pyramid (unit, integration, e2e), TDD/BDD methodologies, code coverage analysis, and naming conventions to ensure high-quality code. It focuses on integrating testing into development workflows for robust software.

When to Use

Use this skill when writing or reviewing code that requires test-driven development, such as implementing new features in a project, debugging failures, or ensuring coverage thresholds. Apply it in scenarios like agile sprints, CI/CD pipelines, or when refactoring code to maintain quality.

Key Capabilities

  • Generate unit tests using TDD: Create tests for functions with assertions based on input/output.
  • Support BDD with Gherkin syntax: Parse feature files and generate step definitions.
  • Analyze testing pyramid: Recommend distribution (e.g., 70% unit, 20% integration, 10% e2e).
  • Enforce coverage strategies: Set thresholds (e.g., >80%) and identify uncovered lines.
  • Apply naming conventions: Enforce patterns like testFunctionName for tests.
  • Integrate with tools: Use APIs to run tests via Jest, Pytest, or Selenium.

Usage Patterns

To use this skill, invoke OpenClaw with specific commands in your chat or script. Start by providing code snippets for analysis, then request test generation. For TDD, alternate between writing tests and code. In BDD, supply user stories first. Always specify the test type (unit, integration, e2e) to tailor outputs. Configure via a JSON file, e.g., set "coverageThreshold": 80 in .openclaw/config.json. For automation, chain with build tools like Make or npm scripts.

Common Commands/API

Invoke via OpenClaw CLI or API. Use environment variable $OPENCLAW_API_KEY for authentication in API calls.

  • CLI Command: Run unit tests with claw test run --type unit --file src/myfile.js --coverage true Example snippet: claw test run --type unit --file tests/unit.js // Output: Test results with coverage report
  • API Endpoint: POST to https://api.openclaw.ai/v1/test/run with JSON body {"type": "integration", "paths": ["src/"], "threshold": 85} Example snippet: curl -H "Authorization: Bearer $OPENCLAW_API_KEY" \ -d '{"type":"e2e","paths":["tests/e2e/"]}' https://api.openclaw.ai/v1/test/run
  • Common Flags: --type [unit/integration/e2e] for test level, --coverage for reports, --bdd for Gherkin parsing.
  • Config Format: Use YAML for test configs, e.g., tests: unit: true coverage: 90

To generate a TDD test, say: "Generate a unit test for this function: def add(a, b): return a + b"

Integration Notes

Integrate this skill with existing tools by exporting results to formats like JUnit XML or HTML reports. For CI/CD, add hooks in GitHub Actions or Jenkins, e.g., run claw test run --type e2e as a step. If using frameworks, map OpenClaw outputs to Jest configs by specifying adapters in .openclaw/config.json, like "adapter": "jest". Ensure API compatibility by setting the env var $OPENCLAW_API_KEY in your pipeline scripts. For multi-service apps, combine with monitoring tools via webhooks to trigger tests on code changes.

Error Handling

When errors occur, check for common issues like invalid test types or authentication failures. Use try-catch in scripts, e.g.,

try {
  await claw.test.run({ type: 'unit' });
} catch (error) {
  console.error(error.message);  // e.g., "API key missing"
}

Handle API errors by verifying $OPENCLAW_API_KEY and response codes (e.g., 401 for unauthorized). For test failures, parse OpenClaw outputs for specifics, like "Assertion failed on line 5". Retry transient errors with exponential backoff, and log details in JSON format for debugging.

Usage Examples

  1. TDD for a simple function: Provide code like def multiply(a, b): return a * b, then command: "Write a unit test for this using pytest." OpenClaw responds with: def test_multiply(): assert multiply(2, 3) == 6 assert multiply(0, 5) == 0 Run it via claw test run --type unit --file tests.py.
  2. BDD for user story: Supply: "Feature: User login", then: "Generate step definitions." OpenClaw outputs: Given("user is on login page") do visit '/login' end Integrate by running claw test run --bdd --file features/login.feature.

Graph Relationships

  • Related to: "tdd" (direct link for TDD workflows)
  • Related to: "bdd" (shared for behavior-driven testing)
  • Related to: "quality" (overlaps on code coverage and standards)
  • Connected via: "testing" cluster for pyramid strategies
  • No direct edges to unrelated clusters like "deployment"

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.57%
按下载量换算46

Claude

27.52%
按下载量换算35

Cursor

18.46%
按下载量换算23

Gemini CLI

9.15%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills