← 返回 Skills 市场
gechengling

Agentic Test Engineer

作者 lingfeng-19 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
106
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install agentic-test-engineer
功能描述
AI-powered autonomous test generation and self-healing test maintenance. Generates unit/integration/E2E tests, detects flaky tests, auto-fixes broken selecto...
使用说明 (SKILL.md)

\r \r

Agentic Test Engineer\r

\r

Overview\r

\r An AI-powered autonomous testing assistant that revolutionizes QA workflows. It generates comprehensive test suites from user stories and code, self-heals broken selectors using visual AI, detects and diagnoses flaky tests, and continuously maintains test coverage metrics — all with minimal human intervention.\r \r

Triggers\r

\r

  • "generate tests for [feature/code]"\r
  • "write unit tests for [function]"\r
  • "self-heal my broken test"\r
  • "find flaky tests in [project]"\r
  • "check test coverage for [module]"\r
  • "run E2E tests for [workflow]"\r
  • "why is my test failing"\r
  • "智能测试生成"\r
  • "自愈测试修复"\r
  • "测试覆盖率分析"\r \r

Workflow\r

\r

Step 1: Detect Context\r

\r Identify the testing scenario:\r

  • Unit tests: Python, JavaScript, TypeScript, Java, Go functions\r
  • Integration tests: API endpoints, database interactions, service meshes\r
  • E2E tests: Browser workflows (Playwright, Cypress, Selenium)\r
  • API tests: REST/GraphQL endpoints, contract testing\r
  • Flaky test diagnosis: Test results history, timing issues, async race conditions\r
  • Self-healing: Broken selectors, changed DOM, moved UI elements\r \r

Step 2: Test Generation\r

\r For test generation:\r

  1. Analyze code structure, user story, or API spec\r
  2. Select appropriate testing framework:\r
    • Python: pytest, unittest\r
    • JavaScript/TypeScript: Jest, Vitest, Playwright, Cypress\r
    • Java: JUnit, TestNG\r
    • Go: testing package, testify\r
  3. Generate comprehensive test cases:\r
    • Happy path scenarios\r
    • Edge cases and boundary conditions\r
    • Error handling scenarios\r
    • Negative test cases\r
  4. Include setup/teardown fixtures\r
  5. Add data-driven test parameters\r \r

Step 3: Self-Healing (When Triggered)\r

\r When a test breaks due to UI changes:\r

  1. Capture the failing selector/error message\r
  2. Use visual AI to identify the new element location\r
  3. Generate updated selector using multiple strategies:\r
    • Text content matching\r
    • Semantic role/labels\r
    • Visual proximity to stable elements\r
    • Shadow DOM traversal\r
  4. Validate the fix across related tests\r
  5. Log the healing action for audit trail\r \r

Step 4: Flaky Test Detection\r

\r

  1. Collect test execution history from CI/CD\r
  2. Analyze failure patterns:\r
    • Timing issues (race conditions, async waits)\r
    • Resource contention (DB connections, file locks)\r
    • Environment instability\r
    • Test interdependencies\r
  3. Generate diagnosis report with:\r
    • Probability of flakiness\r
    • Root cause analysis\r
    • Recommended fixes (add explicit waits, mock external calls, etc.)\r \r

Step 5: Coverage Analysis\r

\r

  1. Parse code and existing test files\r
  2. Calculate line/branch/function coverage\r
  3. Identify untested code paths\r
  4. Suggest priority test cases for uncovered areas\r
  5. Generate coverage trend report\r \r

Input/Output Examples\r

\r

Example 1: Generate Unit Tests\r

\r Input:\r

Generate unit tests for this Python function:\r
def calculate_premium(age: int, health_score: float, coverage_amount: float) -> float:\r
    if age \x3C 18 or age > 70:\r
        raise ValueError("Age must be between 18 and 70")\r
    base_rate = coverage_amount * 0.05\r
    health_factor = 1.0 - (health_score / 100) * 0.3\r
    return base_rate * health_factor\r
```\r
\r
**Output:**\r
```python\r
import pytest\r
from your_module import calculate_premium\r
\r
class TestCalculatePremium:\r
    def test_happy_path(self):\r
        result = calculate_premium(age=30, health_score=80, coverage_amount=100000)\r
        assert 3000 \x3C= result \x3C= 5000\r
\r
    def test_age_boundary_18_valid(self):\r
        result = calculate_premium(age=18, health_score=50, coverage_amount=100000)\r
        assert result == 100000 * 0.05 * (1.0 - 0.5 * 0.3)\r
\r
    def test_age_boundary_70_valid(self):\r
        result = calculate_premium(age=70, health_score=50, coverage_amount=100000)\r
        assert isinstance(result, float)\r
\r
    def test_age_too_young(self):\r
        with pytest.raises(ValueError, match="Age must be between"):\r
            calculate_premium(age=17, health_score=80, coverage_amount=100000)\r
\r
    def test_age_too_old(self):\r
        with pytest.raises(ValueError, match="Age must be between"):\r
            calculate_premium(age=71, health_score=80, coverage_amount=100000)\r
\r
    @pytest.mark.parametrize("health_score,expected_factor_range", [\r
        (0, (0.97, 1.01)),\r
        (50, (0.82, 0.88)),\r
        (100, (0.69, 0.71)),\r
    ])\r
    def test_health_factor_bounds(self, health_score, expected_factor_range):\r
        result = calculate_premium(age=30, health_score=health_score, coverage_amount=100000)\r
        lower, upper = expected_factor_range\r
        assert lower * 5000 \x3C= result \x3C= upper * 5000\r
```\r
\r
### Example 2: Self-Healing a Broken Playwright Test\r
\r
**Input:**\r
```\r
My Playwright test is failing: Selector ".submit-button" not found.\r
The button text is "提交保单" now.\r
```\r
\r
**Output:**\r
```\r
🔧 Self-Healing Analysis:\r
- Original selector: ".submit-button"\r
- Issue: UI updated, element selector changed\r
- Healed selector strategy: text-content match\r
\r
Generated alternatives:\r
1. await page.getByRole('button', { name: '提交保单' }).click()\r
2. await page.locator('button[type="submit"]').click()\r
3. await page.getByText('提交保单').click()\r
\r
Recommended (most robust): Option 1\r
- Uses semantic role binding (survives CSS class changes)\r
- Language-aware (works with i18n updates)\r
```\r
\r
### Example 3: Flaky Test Diagnosis\r
\r
**Input:**\r
```\r
Diagnose why this test is flaky:\r
it('should load user dashboard', async () => {\r
  const dashboard = await page.locator('.dashboard').waitFor();\r
  const count = await dashboard.locator('.card').count();\r
  expect(count).toBeGreaterThan(0);\r
});\r
```\r
\r
**Output:**\r
```\r
Flaky Test Report:\r
- Flakiness probability: 87% (HIGH)\r
- Root cause: Race condition between page load and element appearance\r
\r
Recommended fixes:\r
1. Replace implicit waitFor() with explicit wait:\r
   await expect(page.locator('.dashboard')).toBeVisible({ timeout: 10000 })\r
\r
2. Add network idle wait:\r
   await page.waitForLoadState('networkidle')\r
\r
3. Use data-testid for stability:\r
   \x3Cdiv data-testid="user-dashboard" className="dashboard">...\x3C/div>\r
\r
4. Add retry wrapper for truly async cases:\r
   await expect.poll(async () => {\r
     return await page.locator('.card').count();\r
   }, { timeout: 10000 }).toBeGreaterThan(0);\r
```\r
\r
## Key Capabilities\r
\r
| Capability | Description | Supported Frameworks |\r
|------------|-------------|---------------------|\r
| Test Generation | Generate tests from code/user stories | pytest, Jest, Vitest, JUnit, Playwright, Cypress |\r
| Self-Healing | Auto-fix broken selectors | Playwright, Cypress, Selenium |\r
| Flaky Test Detection | Diagnose intermittent failures | All major frameworks + CI logs |\r
| Coverage Analysis | Measure and report test coverage | Istanbul, pytest-cov, JaCoCo |\r
| API Contract Testing | Validate API schemas and responses | OpenAPI, Postman, Pact |\r
\r
## Best Practices\r
\r
1. **Always add `data-testid` attributes** to UI elements for stable selectors\r
2. **Use explicit waits** instead of `sleep()` — AI will recommend optimal wait strategies\r
3. **Keep tests isolated** — each test should be independent\r
4. **Parameterize test data** — use data-driven tests for variant coverage\r
5. **Review self-healed selectors** — AI suggestions should be human-verified before production\r
\r
## Notes\r
\r
- This skill generates test code only — it does not execute tests directly\r
- For CI/CD integration, combine with `ai-test-strategy-architect` skill\r
- Self-healing suggestions prioritize semantic selectors over CSS class selectors\r
- Coverage analysis requires access to test execution output files (JSON/XML format)\r
安全使用建议
Treat this as an incomplete review: the command sandbox failed while attempting to inspect metadata.json and artifact files, so installation should wait for a successful artifact review.
能力评估
Purpose & Capability
Review is incomplete: filesystem inspection commands failed before metadata.json or artifact contents could be read.
Instruction Scope
No instruction-scope risk could be confirmed from artifact evidence because the artifacts were unavailable.
Install Mechanism
No install-mechanism risk could be confirmed from artifact evidence because install artifacts were unavailable.
Credentials
No environment or capability proportionality risk could be confirmed from artifact evidence.
Persistence & Privilege
No persistence, credential, or privilege behavior could be confirmed from artifact evidence.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install agentic-test-engineer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /agentic-test-engineer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Agentic Test Engineer 1.0.0 – Initial Release - Introduces an AI-powered assistant for autonomous test generation and self-healing test maintenance. - Supports generating unit, integration, E2E, and API tests from code or user stories. - Automates flaky test detection and diagnosis, providing root cause analysis and repair suggestions. - Auto-fixes broken selectors in UI tests using visual AI and multiple selector strategies. - Includes test coverage analysis and suggests new tests for uncovered code. - Provides workflow triggers, detailed step-by-step processes, and practical input/output examples for QA and development teams.
元数据
Slug agentic-test-engineer
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Agentic Test Engineer 是什么?

AI-powered autonomous test generation and self-healing test maintenance. Generates unit/integration/E2E tests, detects flaky tests, auto-fixes broken selecto... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 106 次。

如何安装 Agentic Test Engineer?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install agentic-test-engineer」即可一键安装,无需额外配置。

Agentic Test Engineer 是免费的吗?

是的,Agentic Test Engineer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Agentic Test Engineer 支持哪些平台?

Agentic Test Engineer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Agentic Test Engineer?

由 lingfeng-19(@gechengling)开发并维护,当前版本 v1.0.0。

💬 留言讨论