Skip to content

Instantly share code, notes, and snippets.

@PramodDutta
Created November 13, 2025 06:28
Show Gist options
  • Select an option

  • Save PramodDutta/22ce283346b573cea1c709fe016edc50 to your computer and use it in GitHub Desktop.

Select an option

Save PramodDutta/22ce283346b573cea1c709fe016edc50 to your computer and use it in GitHub Desktop.

AutoQA

AI-Powered Autonomous Testing Framework

Playwright + Google ADK + RAG + DOM Diff + Real-Time Chat UI
Created by Pramod Dutta (The Testing Academy)


πŸ“Œ What This Project Is

This is a fully autonomous AI QA testing agent that converts plain English instructions into real browser automation, using:

  • Python
  • Playwright
  • Google ADK (Agent Developer Kit)
  • Retrieval-Augmented Generation (RAG)
  • DOM Comparison Engine
  • Vector DB (Chroma)
  • Real-time Chat UI (React + TailwindCSS)
  • WebSocket Streaming

🧠 Example

You type:

β€œOpen app.vwo.com β†’ attempt invalid login β†’ verify error message.”

The agent:

  1. Understands your text
  2. Plans each browser action
  3. Runs steps in Playwright
  4. Captures DOM after each step
  5. Uses RAG + DOM diff + pattern matching to verify
  6. Streams everything in a chat-like interface

No scripts.
No locators.
No coding.

This is the future of automation testing.


🎯 Why This Project Exists

Traditional test automation is:

❌ Slow
❌ Fragile
❌ Code-heavy
❌ Hard to maintain

This framework brings:

βœ” Scriptless testing
βœ” Self-verifying steps
βœ” AI-driven test planning
βœ” DOM-intelligent validation
βœ” Fully conversational automation


πŸ–Ό Architecture Diagram


        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚          Chat UI             β”‚
        β”‚  (React + Tailwind + WS)     β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ instruction
                       β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚        FastAPI Backend        β”‚
        β”‚      WebSocket Streaming      β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ passes request
                       β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚        ADK Agent Core         β”‚
        β”‚  - LLM Reasoning (Gemini)     β”‚
        β”‚  - Step Planner               β”‚
        β”‚  - Tool Orchestration         β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ generated steps
                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      Playwright Executor     β”‚ ---> β”‚         DOM Capture          β”‚
β”‚  - Real browser automation   β”‚      β”‚  - DOM HTML                  β”‚
β”‚  - Click, Type, Navigate     β”‚      β”‚  - Element snapshot          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚ DOM                       β”‚
               β–Ό                           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         RAG Verifier         β”‚      β”‚         DOM Diff Engine      β”‚
β”‚  - Chroma Vector DB          β”‚      β”‚  - Pattern matching          β”‚
β”‚  - Embedding comparison      β”‚      β”‚  - Error detection           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚ results                    β”‚ diff
               β–Ό                           β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚        Report Engine         β”‚
        β”‚   (JSON / Allure-ready)      β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜


πŸ“ Project Structure


adk-playwright-agent/
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ .env.example
β”‚
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ main.py                      # FastAPI + WebSocket server
β”‚   β”‚
β”‚   β”œβ”€β”€ agent/
β”‚   β”‚   β”œβ”€β”€ agent_core.py            # ADK-style orchestrator
β”‚   β”‚   β”œβ”€β”€ planner.py               # Natural language β†’ Steps
β”‚   β”‚   β”œβ”€β”€ tools.py                 # Tool bindings (click, type, etc.)
β”‚   β”‚   └── **init**.py
β”‚   β”‚
β”‚   β”œβ”€β”€ executor/
β”‚   β”‚   β”œβ”€β”€ playwright_executor.py   # Real browser automation
β”‚   β”‚   β”œβ”€β”€ dom_capture.py           # DOM snapshot utilities
β”‚   β”‚   └── **init**.py
β”‚   β”‚
β”‚   β”œβ”€β”€ verifier/
β”‚   β”‚   β”œβ”€β”€ dom_compare.py           # DOM diff + embeddings verify
β”‚   β”‚   β”œβ”€β”€ rag_store.py             # Chroma vector DB
β”‚   β”‚   └── **init**.py
β”‚   β”‚
β”‚   β”œβ”€β”€ reporting/
β”‚   β”‚   β”œβ”€β”€ report.py                # JSON test report
β”‚   β”‚   └── **init**.py
β”‚   β”‚
β”‚   └── utils/
β”‚       β”œβ”€β”€ helpers.py               # Shared helpers
β”‚       └── **init**.py
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ vite.config.js
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ tailwind.config.js
β”‚   └── src/
β”‚       β”œβ”€β”€ App.jsx
β”‚       β”œβ”€β”€ main.jsx
β”‚       β”œβ”€β”€ components/
β”‚       β”‚   β”œβ”€β”€ ChatMessage.jsx
β”‚       β”‚   └── InputBox.jsx
β”‚
└── examples/
└── invalid_login.json


πŸ›  How It Works

1️⃣ User sends a command

Example:


"Open app.vwo.com and verify invalid login."

2️⃣ LLM plans steps

βœ“ navigate
βœ“ type username
βœ“ type password
βœ“ click login
βœ“ assert error message

3️⃣ Playwright executes steps

  • Opens browser
  • Performs actions
  • Captures DOM

4️⃣ DOM Verifier checks

  • Error text
  • Similarity to past error pages
  • DOM structural differences
  • Embedding comparison

5️⃣ Chat UI shows real-time updates

Every step streams live:


β–Ά Step started: navigate
βœ“ Step completed
β–Ά Verifying DOM...

6️⃣ Report is generated


▢️ How to Run Locally (Complete Guide)

1. Clone repo

git clone https://github.com/yourname/adk-playwright-agent
cd adk-playwright-agent

2. Install backend

pip install -r requirements.txt

3. Install Playwright browsers

playwright install

4. Create .env

LLM_PROVIDER=ollama
OLLAMA_HOST=http://localhost:11434
CHROMA_PERSIST_DIR=./chroma
PLAYWRIGHT_HEADLESS=false

5. Run backend

uvicorn app.main:app --reload --port 8080

6. Start frontend

cd frontend
npm install
npm run dev

Open browser: πŸ‘‰ http://localhost:5173


πŸ“Έ Screenshots (Add later)

/assets/chat-ui.png
/assets/test-run.png
/assets/dom-verify.png

🚧 Future Roadmap

Phase 1 β€” Advanced Verifications

  • Screenshot pixel diff
  • Automatic locator healing
  • XHR/Network validation

Phase 2 β€” Multi-Agent Architecture

  • Planner agent
  • Locator agent
  • Execution agent
  • Verification agent

Phase 3 β€” Test Recording β†’ NL Test Generation

  • Auto-generate test cases
  • Self-healing flows

Phase 4 β€” Visual Test Reports

  • Allure integration
  • Visual diffs
  • Failure heatmaps

Phase 5 β€” SaaS Platform

  • Cloud dashboard
  • Test run history
  • Team collaboration
  • Webhooks + API keys

🀝 Contributing

Pull Requests are welcome!

  • Add more agents
  • Improve DOM verification
  • Add new UI features
  • Extend RAG pipeline
  • Improve planner

πŸ“œ License

MIT License.


⭐ Credits

Built with ❀️ by Pramod Dutta – The Testing Academy


---

If you want, I can also generate:

βœ… README Banner image  
βœ… GitHub Wiki pages  
βœ… API Documentation  
βœ… Full Java version of the framework  
πŸ’‘ Just tell me!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment