Delivered remotely for a business based in San Jose, United States. Names withheld by agreement.
Project Overview
Continuous deployment pipelines routinely stall at the final gate: end-to-end browser verification. Frontend teams refactor component hierarchies and design tokens daily, yet legacy Playwright or Selenium suites remain tightly coupled to fragile CSS classes and positional XPaths. Engineers end up spending sprint cycles diagnosing false-negative test failures rather than shipping product code.
We built an autonomous software testing platform that bridges deterministic browser automation with targeted AI recovery. A React workbench lets QA engineers author, inspect, and approve test flows visually, while a Python FastAPI control plane coordinates containerized Playwright runners that execute regressions fast and repair broken selectors when interfaces evolve.
Fragility in Traditional Browser QA
Engineering organizations operating fast-moving web applications consistently run into four structural bottlenecks with conventional E2E frameworks:
- Selector rot across routine UI edits: Wrapping a button in a new layout container or renaming utility classes shatters dozens of test specs that validate otherwise healthy user journeys.
- Opaque failure diagnostics: Raw CI logs rarely show whether a timeout stemmed from a missing DOM node, a stalled GraphQL mutation, or an unintended modal overlay.
- Runaway cost of naive AI agents: Re-evaluating screenshots with a multimodal model on every single step makes full regression suites prohibitively slow and unpredictable.
- Shared state contamination: Parallel test workers reusing cookies, local storage, or seeded accounts collide unpredictably, eroding engineering trust in red builds.
Architectural Strategy
Our core design principle was deterministic execution by default, AI recovery by exception. Rather than replacing Playwright with a slow, purely generative agent loop, the platform compiles each test journey into structured Playwright steps anchored to ARIA roles, accessible names, and stable semantic attributes.
When a suite executes cleanly, zero LLM inference runs—Playwright drives browsers directly at native speed. Only when a locator times out after a UI refactor does the runner emit an accessibility-tree snapshot, DOM neighborhood context, and viewport crop to Python's healing service. The resolver proposes a ranked replacement locator, validates it in situ, and surfaces the proposed selector patch in React for human sign-off.
Core Capabilities
- Natural-Language to Playwright Synthesis: QA authors describe critical flows or record interactive sessions in the browser; Python translates intent into versioned, inspectable Playwright specifications.
- Scoped Self-Healing Locators: When expected buttons, inputs, or table cells shift, the healing engine matches semantic intent across accessibility trees while strictly preserving business-logic assertions.
- Synchronized Trace Replay in React: Engineers scrub frame-by-frame screenshots alongside synchronized DOM snapshots, console logs, network HAR payloads, and Playwright action timelines.
- Automated Flake Classification: Heuristic and statistical classifiers compare failure signatures against prior commits to separate deterministic regressions from transient network jitter.
- Pull-Request Suite Selection: Git diff analysis maps modified frontend routes and components to targeted Playwright shards, running smoke coverage immediately while scheduling deeper cross-browser sweeps.
Technical Architecture
CI webhooks or scheduled triggers enter FastAPI, which resolves environment bindings, shards tests in Redis based on historical runtimes, and dispatches jobs to isolated Docker Playwright workers. Each worker spins up fresh browser contexts, executes deterministic steps, and invokes Python's healing resolver only on locator misses before persisting scrubbed traces and updating commit statuses.
Flow: CI Webhook / React Studio → FastAPI Scheduler → Redis Shard Queue → Ephemeral Docker Playwright Runners → Accessibility-Tree Snapshot → Python AI Locator Healer (Fallback Only) → Scrubbed Trace Store (PostgreSQL) → React Triage UI & PR Check
Keeping browser execution decoupled behind Redis queues lets platform operators scale Chromium, WebKit, and Firefox worker pools independently from the Python API tier and React frontend.
Technology Stack
| Category | Technology detail |
|---|---|
| Test Workbench UI | React and TypeScript powering the visual step editor, DOM inspector, and trace timeline |
| Control Plane API | Python and FastAPI managing suite scheduling, CI webhooks, and healing policies |
| Browser Execution | Playwright running headless Chromium, WebKit, and Firefox sessions per shard |
| Self-Healing Engine | Python multimodal and accessibility-tree resolver repairing drifted element locators |
| Artifact & Trace Store | PostgreSQL storing test definitions, locator lineage, and flake classifications |
| Execution Queue | Redis coordinating parallel shard dispatch, retries, and browser worker leases |
| Worker Isolation | Docker containers providing clean ephemeral browser profiles and network sandboxes |
| Visual & Network Diff | Perceptual pixel comparison paired with HAR request assertions inside Playwright |
| CI/CD Integration | Signed webhook adapters for GitHub Actions, GitLab CI, and pull-request checks |
Engineering Trade-offs & Solutions
| Engineering Challenge | Solution & Trade-off |
|---|---|
| Balancing self-healing convenience against false-positive passes | Restricted AI recovery strictly to element identification while forbidding automated assertion edits, requiring PR-style approval in React to persist healed selectors; adds a review step while guaranteeing test integrity. |
| Avoiding massive token and latency bills across large regression suites | Executed compiled Playwright locators natively and gated LLM inference behind selector-miss exceptions; requires maintaining structured step ASTs alongside prose specs. |
| Capturing rich failure artifacts without leaking staging secrets | Built a Python pre-persistence sanitizer that masks Authorization headers, session cookies, and password inputs in HARs and DOM snapshots; adds minor post-run processing overhead. |
| Preventing cross-test state pollution during aggressive parallelization | Provisioned fresh Playwright browser contexts per spec inside ephemeral Docker workers paired with per-run test data namespaces; trades slightly higher container memory overhead for deterministic isolation. |
Security & Reliability
Automated QA platforms routinely hold keys to staging portals, internal admin panels, and pre-release builds. Every runner executes inside an unprivileged Docker container with strict egress allowlists preventing test scripts from reaching unapproved external hosts. Sensitive test credentials remain encrypted at rest, materialize strictly inside short-lived worker memory, and never travel to external model endpoints during locator healing.
Before any accessibility snapshot leaves the runner for AI resolution, Python strips form input values, bearer tokens, and PII-matching text nodes so healing inspects structural attributes rather than customer-like test records. On the reliability side, Redis visibility timeouts automatically reclaim orphaned shards if a browser process crashes mid-suite, ensuring CI pipelines never hang indefinitely waiting on a dead worker.
Performance & Scale
Full-suite E2E latency depends heavily on smart work distribution. FastAPI tracks rolling step timings per test file in PostgreSQL and packs shards using longest-processing-time scheduling so one slow checkout spec never drags down an entire build. Playwright blocks redundant third-party analytics beacons inside test contexts and shares pre-authenticated storage-state tokens safely across isolated contexts where read-only journeys permit.
Inside the React triage interface, trace payloads load lazily: summary status badges render immediately via streamed events, while heavy DOM snapshots and network waterfalls fetch on demand when an engineer clicks a failed step.
Operational Outcomes
Combining deterministic Playwright execution with bounded, reviewable AI locator healing transformed end-to-end testing from a brittle bottleneck into a dependable release gate:
- Resilient regression suites: Routine layout adjustments and CSS refactors heal transparently at the locator layer instead of blocking pull requests with false alarms.
- Faster failure root-causing: Unified React trace timelines expose exact DOM state, console errors, and failing API payloads in one view, eliminating manual local reproduction.
- Controlled inference footprint: Running AI resolution strictly on drifted steps keeps test execution fast and predictable as suite coverage expands.
- Auditable test governance: Explicit selector-diff approvals and quarantined flake tracking keep engineering teams confident in every green deployment check.