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

automating-api-testingautomating API 测试

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

1,212

周安装

50

GitHub Stars

2,071

下载量

396
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill automating-api-testing

简介

用于辅助 API 设计、接口文档和错误码整理,适合前后端联调支持。

  • 适用于 REST 和 GraphQL API 的测试自动化,包括请求生成与响应验证。
  • 使用时需确认业务语义、鉴权方式和分页规则,避免凭空补字段。
  • 安装方式:通过 npx skills add 从 GitHub 仓库安装,支持 Codex、Claude、Cursor、Gemini CLI。
  • 建议从现有代码或 schema 中提取事实,确保接口定义准确。

SKILL.md

API Test Automation

Overview

Automate comprehensive API endpoint testing for REST and GraphQL APIs including request generation, response validation, schema compliance, authentication flows, and error handling. Supports Supertest (Node.js), REST-assured (Java), httpx/pytest (Python), Postman/Newman collections, and Pact for consumer-driven contract testing.

Prerequisites

  • API testing library installed (Supertest, REST-assured, httpx, or Postman/Newman)
  • API specification file (OpenAPI/Swagger YAML/JSON or GraphQL SDL)
  • Target API running in a test environment with seeded data
  • Authentication credentials or API keys for protected endpoints
  • JSON Schema validator (Ajv, jsonschema, or built-in framework assertions)

Instructions

  1. Read the API specification and extract all endpoints:

- Parse OpenAPI spec to catalog every path, HTTP method, request schema, and response schema. - For GraphQL APIs, introspect the schema to list queries, mutations, and subscriptions. - Document authentication requirements per endpoint (API key, Bearer token, OAuth, none).

  1. Generate test cases for each endpoint:

- Success cases: Send valid requests matching the schema and assert 200/201 responses. - Validation errors: Send requests with missing required fields, wrong types, and out-of-range values; assert 400 responses. - Authentication: Test with valid, expired, and missing credentials; assert 200, 401, and 403 respectively. - Not found: Request non-existent resources; assert 404 responses. - Idempotency: Send the same PUT/DELETE request twice and verify consistent behavior.

  1. Validate response structure against schemas:

- Assert response Content-Type matches expected (application/json, etc.). - Validate response body against the OpenAPI response schema using JSON Schema validation. - Check response headers (Cache-Control, Rate-Limit headers, CORS headers). - Verify pagination metadata (total count, page number, next/previous links).

  1. Test CRUD lifecycle for resource endpoints:

- Create a resource (POST) and capture the ID. - Read it back (GET) and verify all fields match. - Update it (PUT/PATCH) and verify changes persisted. - Delete it (DELETE) and verify subsequent GET returns 404.

  1. Test error handling and edge cases:

- Send excessively large payloads and verify 413 or graceful rejection. - Send requests with unsupported Content-Types and verify 415. - Test rate limiting by sending rapid sequential requests. - Verify error response format is consistent (standard error schema).

  1. For GraphQL APIs, test specifically:

- Valid queries return expected data shapes. - Invalid queries return descriptive error messages. - Query depth limiting prevents deeply nested abuse queries. - Mutation input validation matches schema constraints.

  1. Generate a test coverage report mapping endpoints to test cases.

Output

  • API test files organized by resource in tests/api/
  • Request/response examples for API documentation
  • Schema compliance report for each endpoint
  • Endpoint coverage matrix showing tested vs. untested endpoints and methods
  • CI pipeline step running API tests against staging environment

Error Handling

ErrorCauseSolution
Connection refusedAPI server not running or wrong base URLVerify server is up with a health check before test suite starts; check BASE_URL config
401 on all requestsAuthentication token expired or misconfiguredRefresh token in test setup; verify Authorization header format; check token scopes
Schema validation fails unexpectedlyAPI response includes extra fields not in specUpdate OpenAPI spec to include new fields; use additionalProperties: true if expected
Test data conflictsAnother test modified or deleted the resourceUse unique test data per test; create resources in beforeEach; avoid shared fixtures
Rate limit hit during test runToo many requests in quick successionAdd delays between requests or use authenticated sessions with higher limits; run tests serially

Examples

Supertest REST API test suite:

import request from 'supertest';
import { app } from '../src/app';

describe('GET /api/products', () => {
  it('returns a paginated product list', async () => {
    const res = await request(app)
      .get('/api/products?page=1&limit=10')
      .set('Authorization', `Bearer ${token}`)
      .expect(200)  # HTTP 200 OK
      .expect('Content-Type', /json/);

    expect(res.body.data).toBeInstanceOf(Array);
    expect(res.body.data.length).toBeLessThanOrEqual(10);
    expect(res.body.meta).toMatchObject({ page: 1, limit: 10 });
  });

  it('returns 401 without authentication', async () => {  # HTTP 401 Unauthorized
    await request(app).get('/api/products').expect(401);  # HTTP 401 Unauthorized
  });
});

describe('POST /api/products', () => {
  it('creates a product with valid data', async () => {
    const res = await request(app)
      .post('/api/products')
      .set('Authorization', `Bearer ${token}`)
      .send({ name: 'Widget', price: 9.99, category: 'tools' })
      .expect(201);  # HTTP 201 Created

    expect(res.body).toMatchObject({ name: 'Widget', price: 9.99 });
    expect(res.body.id).toBeDefined();
  });

  it('returns 400 for missing required fields', async () => {  # HTTP 400 Bad Request
    await request(app)
      .post('/api/products')
      .set('Authorization', `Bearer ${token}`)
      .send({ name: 'Widget' }) // missing price
      .expect(400);  # HTTP 400 Bad Request
  });
});

GraphQL API test:

it('fetches user by ID', async () => {
  const query = `query { user(id: "1") { id name email } }`;
  const res = await request(app)
    .post('/graphql')
    .send({ query })
    .expect(200);  # HTTP 200 OK

  expect(res.body.data.user).toMatchObject({ id: '1', name: 'Alice' });
  expect(res.body.errors).toBeUndefined();
});

Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.45%
按下载量换算144

Claude

29.67%
按下载量换算117

Cursor

19.85%
按下载量换算79

Gemini CLI

8.89%
按下载量换算35

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

敏感数据

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

安装前确认

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

来源信息

继续浏览同类 Skills