← Back to Skills Marketplace
gechengling

Agentic Test Engineer

by lingfeng-19 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
106
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install agentic-test-engineer
Description
AI-powered autonomous test generation and self-healing test maintenance. Generates unit/integration/E2E tests, detects flaky tests, auto-fixes broken selecto...
README (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
Usage Guidance
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install agentic-test-engineer
  3. After installation, invoke the skill by name or use /agentic-test-engineer
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug agentic-test-engineer
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 106 downloads so far.

How do I install Agentic Test Engineer?

Run "/install agentic-test-engineer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Agentic Test Engineer free?

Yes, Agentic Test Engineer is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Agentic Test Engineer support?

Agentic Test Engineer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Agentic Test Engineer?

It is built and maintained by lingfeng-19 (@gechengling); the current version is v1.0.0.

💬 Comments