Unified Test Management
Powered by Any LLM

TestWeaveX brings test case management, execution, and AI-assisted generation into a single Git-native platform. The LLM suggests. You decide.

$pip install testweavex

Getting Started

From install to your first gap report in under 10 minutes.

  1. Install and initialise

    pip install testweavex
    tw init --llm-provider anthropic

    This creates testweavex.config.yaml in your project root and a testweavex/skills/ folder with the 10 built-in skill files.

  2. Run your test suite

    tw                         # same as pytest — all flags work
    tw tests/login.feature    # run a specific feature
    tw -k smoke -n 4          # filter + parallel

    Results are stored automatically in .testweavex/results.db. No configuration required.

  3. View your first gap report

    tw gaps --limit 20

    TestWeaveX compares your TCM against your automation suite and surfaces unautomated tests ranked by priority score. Generate automation for any gap with tw gaps --generate.

Team mode: Add --results-server https://your-server --token $TOKEN to any tw command to share results across your team. One docker-compose up starts the server.

CLI Reference

Every pytest flag works with tw unchanged. TestWeaveX adds its own flags alongside.

CommandDescriptionKey Options
tw [paths]Run tests (wraps pytest)--results-server, --token, --sync-tcm, --gaps
tw initInitialise TestWeaveX in a project--llm-provider, --tcm
tw generateGenerate tests from a feature description--feature, --skill, --output
tw gapsRun gap analysis, show ranked report--limit, --min-score, --generate
tw importImport from external TCM or CSV--source (testrail/xray/csv)
tw statusShow coverage map and summary--format (table/json/html)
tw historyShow execution history--id, --last-n
tw serveStart local Web UI--port (default: 8080)
tw migrateMigrate from external TCM--source, --dry-run
tw syncPush results to external TCM--tcm, --run-id

CI/CD Example (GitHub Actions)

- name: Run tests
  run: |
    tw run --suite regression \
           --results-server ${{ secrets.TW_SERVER }} \
           --token ${{ secrets.TW_TOKEN }} \
           --sync-tcm testrail

Configuration

Create testweavex.config.yaml in your project root. All values support ${ENV_VAR} interpolation. Missing keys use defaults.

# testweavex.config.yaml
llm:
  provider: anthropic        # openai | anthropic | ollama | azure
  model: claude-sonnet-4-6
  api_key: ${ANTHROPIC_API_KEY}
  temperature: 0.3
  max_retries: 3
  timeout_seconds: 30

results_server: ${TESTWEAVEX_SERVER}  # optional — team mode

tcm:
  provider: none              # testrail | xray | none

gap_analysis:
  scoring_weights:
    priority:  0.30
    test_type: 0.25
    defects:   0.20
    frequency: 0.15
    staleness: 0.10
  match_threshold: 0.65
  top_gaps_default: 10

LLM Providers

ProviderKey SettingModels
Anthropicapi_key: ${ANTHROPIC_API_KEY}claude-sonnet-4-6, claude-opus-4-7, claude-haiku-4-5
OpenAIapi_key: ${OPENAI_API_KEY}gpt-4o, gpt-4-turbo, gpt-3.5-turbo
Ollamabase_url: http://localhost:11434llama3, mistral, phi-3, any local model
Azure OpenAIazure_endpoint, deployment_nameAll Azure-deployed OpenAI models

Architecture

TestWeaveX is a pytest plugin with a thin CLI wrapper. All functionality flows through one of three pipelines.

PipelineInputOutput
GenerationFeature description + skill fileApproved Gherkin + step definitions in repo
ExecutionFeature files + pytest configTest results in storage + TCM updated
Gap AnalysisTCM test cases + automation suiteRanked gap list + optional generated automation

Component Map

ModuleResponsibilityPhase
core/models.pyPydantic data models — shared contract1
core/config.pyYAML config loader1
storage/sqlite.pyLocal SQLite persistence (default)1
llm/Provider-agnostic LLM adapter layer2
skills/YAML skill files for each test type2
generation/Feature → Gherkin → step definitions3
execution/plugin.pypytest plugin hooks4
gap/Gap detection, scoring, automation trigger5
web/FastAPI + React dashboard6
tcm/TestRail + Xray connectors7

Stable ID Algorithm

Every test case gets a deterministic 64-character ID derived from its feature file path and scenario name. This ID is stable across machines, CI runs, and environments. The algorithm is frozen — never change it after first deployment.

import hashlib

def generate_stable_id(*parts: str) -> str:
    key = "|".join(parts).encode("utf-8")
    return hashlib.sha256(key).hexdigest()  # full 64 chars

# test_case_id = generate_stable_id(feature_path, scenario_name)
# feature_id   = generate_stable_id(feature_path)

Gap Priority Scoring

Gaps are ranked by a six-signal weighted score (0.0–1.0). Higher = automate first.

SignalWeightMeaning
Priority30%P1 tests must be automated before P4
Test Type25%Smoke/E2E gaps hurt most (score 1.0/0.9)
Defect History20%Tests linked to past bugs are high value
Frequency15%Frequently-run manual tests benefit most from automation
Staleness10%Tests not run recently carry higher regression risk

Contributing

Repository Structure

RepoPurpose
testweavex/testweavexCore Python library (this package)
testweavex/testweavex-serverSelf-hosted result server (Docker)
testweavex/testweavex-skillsCommunity skill file contributions
testweavex/testweavex-docsFull Docusaurus documentation site

Adding a Custom Skill

The easiest way to contribute is a new skill YAML file. Create testweavex/skills/custom/your-skill.yaml:

name: custom/your-skill
display_name: Your Skill Name
description: What this skill generates

prompt_template: |
  You are a senior QA engineer.
  Feature: {feature_description}
  Generate {n_suggestions} test scenarios that...
  Return JSON: title, gherkin, confidence, rationale, suggested_tags

assertion_hints:
  - Verify primary outcome
tags: [custom]
priority: 3

Development Setup

git clone https://github.com/testweavex/testweavex
cd testweavex
pip install -e ".[dev]"
pytest tests/ -v
Contribution areas: Skill YAML files (lowest barrier), LLM adapter implementations for new providers, external TCM connectors, bug fixes in core library.