Token导航 LogoToken导航

Agent Skill · 开发

test-automation(测试自动化)

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

test-automation 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描有未通过项,按安装量在开发类的 21,746 个 Skill 里排第 12,279。

总安装 1,357周安装 56GitHub Stars 14下载 444核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/vladm3105/aidoc-flow-framework --skill test-automation

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于辅助测试设计、自动化测试、用例整理和回归验证。适合编写单元测试、端到端测试或根据失败日志定位问题。需确认项目测试框架、运行命令和夹具数据后使用。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。涉及浏览器或外部服务时应区分本地模拟与生产环境。

test-automation 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/test-automation

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/vladm3105/aidoc-flow-framework --skill test-au…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

test-automation 怎么安装?

在终端执行 npx skills add https://github.com/vladm3105/aidoc-flow-framework --skill test-automation。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

test-automation 支持哪些 AI 工具?

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

test-automation 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

test-automation 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

test-automation 用的人多吗?

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

test-automation 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

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

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

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

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
test-automation

测试自动化 · 本页

1,35714需要联网MIT未通过

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

SKILL.md 原文

test-automation

Description: Automated test generation, BDD execution, coverage analysis, and contract testing

Category: Quality Assurance & Testing

Complexity: High (multi-framework integration + coverage analysis)


Purpose

Transform SDD artifacts (BDD scenarios, requirements, contracts) into executable test suites with comprehensive coverage tracking. Ensures code implementation matches specifications and contracts.


Capabilities

1. BDD Scenario Generation

  • Parse BDD documents (Given-When-Then format)
  • Generate pytest-bdd test files
  • Map scenarios to test functions
  • Handle scenario outlines with examples
  • Generate test fixtures from Given clauses

2. Unit Test Generation

  • Generate unit tests from requirements (REQ documents)
  • Create test templates from SPEC documents
  • Mock generation for dependencies
  • Parameterized test generation
  • Edge case identification from requirements

3. Integration Test Generation

  • API integration tests from CTR contracts
  • Database integration tests from data specifications
  • Service interaction tests
  • End-to-end workflow tests from IMPL documents

4. Contract Testing

  • Consumer-driven contract tests from CTR YAML
  • Schema validation tests
  • API contract compliance verification
  • Breaking change detection
  • Mock server generation from contracts

5. Test Coverage Analysis

  • Line coverage, branch coverage, path coverage
  • Requirement coverage mapping (REQ → Test)
  • Scenario coverage tracking (BDD → Test)
  • Contract coverage validation (CTR → Test)
  • Coverage gap identification

6. Performance Test Generation

  • Load test scenarios from performance requirements
  • Stress test configurations
  • Benchmark test generation
  • SLA validation tests

7. Test Data Generation

  • Realistic test data from specifications
  • Edge case data generation
  • Boundary value analysis
  • Invalid input generation for negative tests

Test Generation Workflow

graph TD
    A[SDD Artifacts] --> B{Artifact Type}
    B -->|BDD| C[Generate BDD Tests]
    B -->|REQ| D[Generate Unit Tests]
    B -->|CTR| E[Generate Contract Tests]
    B -->|SPEC| F[Generate Integration Tests]

    C --> G[pytest-bdd Test Suite]
    D --> H[pytest Unit Test Suite]
    E --> I[Contract Test Suite]
    F --> J[Integration Test Suite]

    G --> K[Execute Tests]
    H --> K
    I --> K
    J --> K

    K --> L[Coverage Analysis]
    L --> M{Coverage Goals Met?}
    M -->|No| N[Identify Gaps]
    M -->|Yes| O[Generate Report]

    N --> P[Generate Additional Tests]
    P --> K

    O --> Q[Update Traceability Matrix]

Usage Instructions

Generate Tests from BDD Scenarios

# Input: BDD/authentication_scenarios.md
# Output: tests/bdd/test_authentication.py

test-automation generate-bdd \
  --input BDD/authentication_scenarios.md \
  --output tests/bdd/test_authentication.py \
  --framework pytest-bdd

Generated test structure:

import pytest
from pytest_bdd import scenarios, given, when, then, parsers

scenarios('{project_root}/BDD/authentication_scenarios.md')

@given('a user with valid credentials')
def user_with_valid_credentials(context):
    context.user = create_test_user(
        username='testuser',
        password='ValidP@ssw0rd'
    )

@when('the user attempts to login')
def user_attempts_login(context):
    context.response = login_api(
        username=context.user.username,
        password=context.user.password
    )

@then('the login should succeed')
def login_succeeds(context):
    assert context.response.status_code == 200
    assert 'access_token' in context.response.json()

Generate Unit Tests from Requirements

# Input: reqs/requirements.md (REQ-AUTH-01)
# Output: tests/unit/test_auth_requirements.py

test-automation generate-unit \
  --input reqs/requirements.md \
  --filter REQ-AUTH-* \
  --output tests/unit/test_auth_requirements.py

Generated test structure:

import pytest
from auth.service import AuthService

class TestREQ_AUTH_001:
    """Test REQ-AUTH-01: Password must be 8-20 characters"""

    def test_password_minimum_length(self):
        """Verify password < 8 characters is rejected"""
        result = AuthService.validate_password('Short1!')
        assert not result.valid
        assert 'minimum 8 characters' in result.error

    def test_password_maximum_length(self):
        """Verify password > 20 characters is rejected"""
        result = AuthService.validate_password('VeryLongPassword123456789!')
        assert not result.valid
        assert 'maximum 20 characters' in result.error

    def test_password_valid_length(self):
        """Verify password 8-20 characters is accepted"""
        result = AuthService.validate_password('ValidP@ss1')
        assert result.valid

Generate Contract Tests

# Input: ctrs/CTR-USER-V1.yaml
# Output: tests/contract/test_user_contract.py

test-automation generate-contract \
  --input ctrs/CTR-USER-V1.yaml \
  --output tests/contract/test_user_contract.py \
  --provider user-service

Generated test structure:

import pytest
from pact import Consumer, Provider, Like, EachLike

@pytest.fixture
def pact():
    return Consumer('user-client').has_pact_with(
        Provider('user-service')
    )

def test_create_user_contract(pact):
    expected = {
        'user_id': Like('123e4567-e89b-12d3-a456-426614174000'),
        'username': Like('testuser'),
        'email': Like('test@example.com'),
        'created_at': Like('2025-01-01T00:00:00Z')
    }

    (pact
     .given('user database is empty')
     .upon_receiving('a request to create a user')
     .with_request('POST', '/api/users')
     .will_respond_with(201, body=expected))

    with pact:
        result = user_api.create_user({
            'username': 'testuser',
            'email': 'test@example.com',
            'password': 'SecureP@ss123'
        })
        assert result.status_code == 201

Execute Test Suite with Coverage

# Run all tests with coverage
test-automation run \
  --coverage \
  --coverage-report html \
  --traceability

# Run specific test category
test-automation run --category bdd
test-automation run --category unit
test-automation run --category contract

# Run tests for specific requirement
test-automation run --requirement REQ-AUTH-01

Generate Coverage Report

test-automation coverage-report \
  --format html \
  --output reports/coverage \
  --include-traceability

Generated report includes:

  • Overall coverage percentage
  • Coverage by requirement (REQ → Test mapping)
  • Coverage by BDD scenario
  • Coverage by contract endpoint
  • Untested code paths
  • Traceability matrix

Test Templates

BDD Test Template (pytest-bdd)

"""
BDD Tests for {feature_name}
Generated from: {bdd_document_path}
Traceability: {requirement_ids}
"""

import pytest
from pytest_bdd import scenarios, given, when, then, parsers

# Load all scenarios from BDD document
scenarios('{bdd_document_path}')

# Fixtures
@pytest.fixture
def context():
    """Test context for sharing state between steps"""
    return {}

# Given steps
@given(parsers.parse('{step_description}'))
def step_given(context, {parameters}):
    # Setup preconditions
    pass

# When steps
@when(parsers.parse('{step_description}'))
def step_when(context, {parameters}):
    # Execute action
    pass

# Then steps
@then(parsers.parse('{step_description}'))
def step_then(context, {parameters}):
    # Verify outcome
    pass

Unit Test Template (pytest)

"""
Unit Tests for {requirement_id}
Requirement: {requirement_description}
Source: {requirement_document}
"""

import pytest
from {module} import {class_or_function}

class Test_{requirement_id}:
    """Test suite for {requirement_id}"""

    @pytest.fixture
    def setup(self):
        """Setup test fixtures"""
        return {class_or_function}()

    def test_positive_case(self, setup):
        """Test expected behavior"""
        result = setup.method({valid_input})
        assert result == {expected_output}

    def test_boundary_case_min(self, setup):
        """Test minimum boundary value"""
        result = setup.method({min_value})
        assert {assertion}

    def test_boundary_case_max(self, setup):
        """Test maximum boundary value"""
        result = setup.method({max_value})
        assert {assertion}

    def test_invalid_input(self, setup):
        """Test error handling"""
        with pytest.raises({expected_exception}):
            setup.method({invalid_input})

Integration Test Template

"""
Integration Tests for {component_name}
Specification: {spec_document}
Contracts: {contract_ids}
"""

import pytest
from {test_client} import TestClient
from {app} import app

@pytest.fixture
def client():
    """Test client for API integration tests"""
    return TestClient(app)

class Test_{component_name}_Integration:
    """Integration test suite for {component_name}"""

    def test_api_endpoint_{operation}(self, client):
        """Test {operation} operation"""
        # Arrange
        test_data = {test_payload}

        # Act
        response = client.{http_method}(
            '{endpoint_path}',
            json=test_data
        )

        # Assert
        assert response.status_code == {expected_status}
        assert response.json() == {expected_response}

Contract Test Template (Pact)

"""
Contract Tests for {service_name}
Contract: {contract_id}
Provider: {provider_service}
Consumer: {consumer_service}
"""

import pytest
from pact import Consumer, Provider, Like, EachLike, Term

@pytest.fixture
def pact():
    return Consumer('{consumer_service}').has_pact_with(
        Provider('{provider_service}'),
        host_name='localhost',
        port=1234
    )

class Test_{contract_id}:
    """Contract test suite for {contract_id}"""

    def test_{operation}_contract(self, pact):
        """Test {operation} contract"""
        # Define expected interaction
        expected = {expected_schema}

        # Setup pact
        (pact
         .given('{provider_state}')
         .upon_receiving('{interaction_description}')
         .with_request('{method}', '{path}')
         .will_respond_with({status}, body=expected))

        # Execute and verify
        with pact:
            result = {client_call}
            assert result == expected

Coverage Analysis

Requirement Coverage

# Map requirements to tests
REQ-AUTH-01 → [
    test_password_minimum_length,
    test_password_maximum_length,
    test_password_valid_length
] (100% covered)

REQ-AUTH-002 → [
    test_password_uppercase_required,
    test_password_lowercase_required
] (50% covered - missing number requirement test)

BDD Scenario Coverage

# Map BDD scenarios to test execution
BDD-LOGIN-001: User Login Success → PASS (covered)
BDD-LOGIN-002: User Login Failure → PASS (covered)
BDD-LOGIN-003: Account Lockout → NOT TESTED (0% covered)

Contract Coverage

# Map contract endpoints to tests
POST /api/users → test_create_user_contract (100% covered)
GET /api/users/{id} → test_get_user_contract (100% covered)
PUT /api/users/{id} → NOT TESTED (0% covered)
DELETE /api/users/{id} → NOT TESTED (0% covered)

Coverage Goals

  • Unit Test Coverage: ≥90% line coverage, ≥80% branch coverage
  • Requirement Coverage: 100% of MUST requirements tested
  • BDD Scenario Coverage: 100% of scenarios executed
  • Contract Coverage: 100% of contract operations tested
  • Integration Coverage: ≥85% of integration paths tested

Test Data Generation

From Requirements

# REQ-USER-001: Username must be 3-20 alphanumeric characters

test_data = {
    'valid': ['abc', 'user123', 'JohnDoe2025', 'a'.repeat(20)],
    'boundary_min': 'ab',  # Too short
    'boundary_max': 'a'.repeat(21),  # Too long
    'invalid': ['ab', 'user@123', 'John Doe', '123', ''],
    'edge_cases': ['aaa', 'zzz', '000', '999']
}

From Contracts

# CTR-USER-V1: User schema

test_data = {
    'valid_user': {
        'username': 'testuser',
        'email': 'test@example.com',
        'age': 25
    },
    'missing_required_field': {
        'username': 'testuser'
        # Missing email
    },
    'invalid_type': {
        'username': 123,  # Should be string
        'email': 'test@example.com',
        'age': 'twenty-five'  # Should be integer
    }
}

Tool Access

Required tools:

  • Read: Read SDD artifacts (BDD, REQ, CTR, SPEC)
  • Write: Generate test files
  • Edit: Update existing tests
  • Bash: Execute test frameworks (pytest, pact)
  • Glob: Find test files and artifacts
  • Grep: Search for requirements and scenarios

Required libraries:

  • pytest
  • pytest-bdd
  • pytest-cov
  • pact-python (for contract testing)
  • hypothesis (for property-based testing)
  • faker (for test data generation)

Integration Points

With doc-flow

  • Automatically generate tests when BDD/REQ documents created
  • Update tests when specifications change
  • Validate test traceability

With code-review

  • Verify test coverage meets minimum thresholds
  • Identify untested code paths
  • Suggest test cases for new code

With contract-tester

  • Execute contract validation tests
  • Verify API compliance with CTR documents
  • Detect breaking changes

With doc-validator

  • Validate test traceability references
  • Ensure all requirements have tests
  • Check test documentation quality

Error Handling

BDD Scenario Parse Error

ACTION: Validate Given-When-Then format
SUGGEST: Correct scenario syntax
VERIFY: Scenario parseable by pytest-bdd
UPDATE: BDD document if needed

Test Generation Failure

ACTION: Identify missing dependencies or invalid specifications
SUGGEST: Fix specification or install required libraries
VERIFY: Generated test is syntactically correct
UPDATE: Test template if needed

Coverage Gap Detected

ACTION: Identify untested requirements/scenarios
SUGGEST: Generate additional test cases
VERIFY: New tests increase coverage
UPDATE: Traceability matrix

Contract Test Failure

ACTION: Compare expected vs actual contract
SUGGEST: Update implementation or contract
VERIFY: Provider and consumer agree on contract
UPDATE: Contract version if breaking change

Best Practices

  1. Generate tests before implementation (TDD approach)
  2. Maintain 1:1 mapping between requirements and tests
  3. Use descriptive test names referencing requirement IDs
  4. Parameterize tests for multiple input scenarios
  5. Mock external dependencies in unit tests
  6. Use real integrations in integration tests
  7. Keep tests independent (no shared state)
  8. Run tests in CI/CD on every commit
  9. Track coverage trends over time
  10. Update tests when specifications change

Limitations

  1. Cannot generate tests for undefined requirements
  2. Test quality depends on specification clarity
  3. Manual review required for generated tests
  4. Performance test load profiles require manual tuning
  5. Complex business logic may need custom test logic
  6. Contract testing requires provider cooperation

Future Enhancements

  1. AI-powered test case generation from natural language
  2. Mutation testing for test effectiveness
  3. Visual test result dashboards
  4. Automatic test healing (update tests when code changes)
  5. Predictive coverage analysis
  6. Test prioritization based on risk
  7. Continuous test optimization

Success Criteria

  • ≥90% unit test coverage
  • 100% requirement test coverage (MUST requirements)
  • 100% BDD scenario execution
  • 100% contract operation coverage
  • ≥85% integration test coverage
  • Zero untested critical paths
  • Test execution time < 10 minutes
  • All test documentation and traceability matrices include Document Control sections with:

- Project metadata (name, version, date, owner, preparer, status) - Document Revision History table tracking test plan changes


Notes

  • Generated tests require manual review and refinement
  • Test data should be isolated per test (no shared fixtures)
  • Contract tests require coordination with service providers
  • Coverage reports saved to reports/coverage/
  • Test execution logs saved to logs/test-runs/
  • Traceability matrix updated after each test run

平台分布

Gemini CLI

28.29%
按下载量换算126

Claude Code

23.38%
按下载量换算104

OpenCode

16.8%
按下载量换算75

Antigravity

11.09%
按下载量换算49

Codex

6.59%
按下载量换算29

windsurf

3.57%
按下载量换算16

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

未通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

继续浏览同类 Skills