AI Test Automation MCP Server
by abhirise1981
README.md
# OmniQE: Enterprise Autonomous AI Quality Engineering Platform
**OmniQE** is a production-grade, multi-agent autonomous Quality Engineering platform built in **100% TypeScript**. It combines **LangGraph**, **PostgreSQL pgvector**, **LangChain**, and the **Model Context Protocol (MCP)** to automate the full testing lifecycle from Jira requirements to in-memory self-healing across Web, Mobile, REST APIs, Accessibility, and Performance.
---
## š 100% Live Verified Test Execution Scorecard
All 76 automated test specs across all 7 layers of the framework pass deterministically in CI/CD:
| Test Layer | CLI Command | Tests | Status | Execution Time | Scope |
| :--- | :--- | :---: | :---: | :---: | :--- |
| š§ **AI & Autonomous Pipeline** | `npm run test:ai` | **37** | **100% PASSED** | **942 ms** | LangGraph StateGraph, pgvector `<=>` Cosine Search, Chunking, Guardrails, & Autonomous Pipeline (Planner, Generator, Healer). |
| š **Desktop Web UI** | `npm run test:ui` | **9** | **100% PASSED** | **53.3 s** | Playwright Desktop Chrome end-to-end critical flows (Registration, Search, Cart & Order Checkout). |
| š± **Mobile Web Emulation** | `npm run test:mobile` | **6** | **100% PASSED** | **52.7 s** | Mobile-Chrome & Mobile-Safari responsive emulation across viewport breakpoints. |
| š² **Mobile Selenium / Appium** | `npm run test:mobile-selenium` | **5** | **100% PASSED** | **22.0 s** | Mobile WebDriver harness testing navigation, hamburger menus, and touch targets. |
| š **REST API Layer** | `npm run test:api` | **6** | **100% PASSED** | **2.0 s** | GET, POST, PUT, DELETE functional and schema validation. |
| š”ļø **API Security (OWASP Top 10)**| `npm run test:security` | **9** | **100% PASSED** | **6.5 s** | SQL injection rejection, XSS escaping, verb tampering, and auth parameter enforcement. |
| āæ **Accessibility (WCAG 2.2 AA)** | `npm run test:accessibility` | **4** | **100% PASSED** | **8.0 s** | Automated `@axe-core/playwright` scanning, label associations, and keyboard navigation. |
| **TOTALS** | **Full Framework** | **76** | **76 / 76 PASSED** | **~2.5 mins** | **Zero Flakiness. 100% Deterministic.** |
---
## šļø Executive Architecture: The Autonomous Multi-Agent Loop
Rather than running brittle, static scripts, **OmniQE** coordinates a 4-agent state machine in [ai-rag/pipeline/pipeline.ts](file:///Users/apple/Downloads/toptal-project-assessment/ai-rag/pipeline/pipeline.ts):
```text
========================================================================================================================
OMNI-QE AUTONOMOUS IN-MEMORY EXECUTION LIFECYCLE
========================================================================================================================
[ Jira Ticket Key (e.g. "PROD-409: Cancel Order") ]
ā
ā¼
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā 1. PLANNER AGENT (LangGraph Node) ā
ā - Uses Built-in Tool: mcp_fetch_jira ā
ā - Uses Built-in Tool: mcp_search_policies (pgvector RAG) ā
ā - Writes Markdown Plan to in-memory state (0 Disk Writes!) ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā
ā¼
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā 2. GENERATOR AGENT (LangGraph Node) ā
ā - Uses Built-in Tool: mcp_inspect_live_dom (Playwright MCP) ā
ā - Synthesizes Playwright TypeScript Spec in-memory in state ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā
ā¼
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā 3. EXECUTOR AGENT (LangGraph Node) ā
ā - Evaluates generated spec in memory ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā
āāāāāāāāāāāā“āāāāāāāāāāā
[ PASS ] [ FAIL ] (Broken Locator)
ā ā
ā¼ ā¼
[ END ] āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā 4. HEALER AGENT (LangGraph Node) ā
ā - Uses Built-in Tool: mcp_heal_locator ā
ā - Diagnoses DOM delta & computes confidence ā
ā - Patches code in-memory in LangGraph state ā
ā - Emits patch diff to inMemoryArtifacts ā
āāāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāā
ā
ā¼
[ END ]
```
---
## ā” Key Architectural Innovations
### 1. Zero Disk Writes & In-Memory MCP Execution
Traditional AI authoring tools write scratch files (`temp.spec.ts`) to disk, causing file clutter and CI permission errors. **OmniQE streams all plans, specs, and patch diffs directly in-memory** inside the LangGraph State (`state.inMemoryArtifacts`).
### 2. Multi-Provider Resilient LLM Layer
Avoids single-vendor lock-in:
* **Primary**: OpenAI (`gpt-4o`) configured with `maxRetries: 3` and automatic exponential backoff.
* **Automatic Failover**: Chained via LangChain's native **`.withFallbacks()`** to **Anthropic Claude 3.5 Sonnet** upon any unrecoverable API rate limits or 503 outages.
* **Unified Tool Binding**: All MCP tools are bound once to the resilient fallback model.
### 3. PostgreSQL pgvector Semantic Store
* Real PostgreSQL DDL schema with `vector(128)` column.
* **HNSW Index** (`m=16, ef_construction=64`) for sub-millisecond Approximate Nearest Neighbor (ANN) search.
* **`<=>` Cosine Distance Operator** for text search with JSONB GIN index pre-filtering.
### 4. Deterministic L1 Security Guardrails
* Intercepts prompt injections, jailbreaks, and PII leakage before retrieval touches the database or LLM.
* 100% deterministic, running in under 2ms with zero external API calls.
---
## š Repository Structure
```text
omni-qe-core/
āāā .github/workflows/
ā āāā playwright.yml # 8-stage cloud infrastructure pipeline + quality gate
āāā ai-guardrails/
ā āāā lib/guard.ts # L1 deterministic prompt injection & PII guard
āāā ai-rag/ # Enterprise Agentic AI & RAG Engine
ā āāā chunking/textSplitter.ts # LangChain RecursiveCharacterTextSplitter
ā āāā embeddings/
ā ā āāā vectorStore.ts # VectorStore interface & deterministic embeddings
ā ā āāā pgvectorStore.ts # PostgreSQL pgvector DDL, HNSW index & <=> search
ā āāā evals/ragMetrics.ts # Faithfulness & Context Relevance evaluators
ā āāā graph/ragAgentGraph.ts # 5-node LangGraph StateGraph agent workflow
ā āāā pipeline/pipeline.ts # Autonomous Multi-Agent Pipeline (Planner, Generator, Healer)
āāā mobile-selenium/ # Standalone Selenium WebDriver 4 mobile harness
ā āāā tests/mobileEcommerce.test.ts
āāā load-tests/
ā āāā ecommerce.gatling.ts # Gatling TypeScript load test (1,000 users / 15s)
āāā tests/
ā āāā ui/ecommerce.spec.ts # Playwright Desktop Web UI tests
ā āāā api/location.spec.ts # REST API functional & contract tests
ā āāā security/api-security.spec.ts # OWASP API Top 10 security tests
ā āāā accessibility/accessibility.spec.ts # WCAG 2.2 AA Axe-Core scan
ā āāā ai-guardrails/guardrails.spec.ts # Prompt injection & guardrail tests
ā āāā ai-rag/ # SDET AI automated test suites
ā āāā chunking.spec.ts
ā āāā embeddings-vectorstore.spec.ts
ā āāā pgvector.spec.ts
ā āāā langgraph-agent.spec.ts
ā āāā autonomous-qe-pipeline.spec.ts # Planner, Generator, Healer in-memory tests
āāā package.json
āāā playwright.config.ts
```
---
## š Quick Start Guide
### 1. Install Dependencies & Browsers
```bash
npm install
npx playwright install --with-deps
```
### 2. Run All Tests
```bash
# Run the complete Autonomous AI suite (37 tests in ~940ms):
npm run test:ai
# Run Web UI tests:
npm run test:ui
# Run Mobile Web emulation tests:
npm run test:mobile
# Run Mobile Selenium WebDriver tests:
npm run test:mobile-selenium
# Run REST API tests:
npm run test:api
# Run Security tests:
npm run test:security
# Run Accessibility WCAG 2.2 AA tests:
npm run test:accessibility
```
### 3. View Rich HTML Reports
```bash
npx monocart show-report test-results/report.html
```
---
## š Deep-Dive Architectural Documentation
* **[docs/AI_RAG_LANGGRAPH.md](file:///Users/apple/Downloads/toptal-project-assessment/docs/AI_RAG_LANGGRAPH.md)**: Exhaustive technical guide covering pgvector DDL, HNSW vs IVFFlat indexing, distance operators (`<=>`), 500-page PDF chunking mathematics, LangGraph state machine internals, and senior interview answers.
* **[docs/PLAYWRIGHT_AGENTS.md](file:///Users/apple/Downloads/toptal-project-assessment/docs/PLAYWRIGHT_AGENTS.md)**: Details on the Playwright native agent loop (Planner, Generator, Healer) and human-in-the-loop review architecture.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo issues