Skip to content

[Feature] 🎬 Test Recording Mode β€” Record clicks β†’ AI-validated self-healing scenariosΒ #1

Description

@khaledbourghida

Problem Statement

Currently, users must describe tests in plain English and let the pipeline generate everything from scratch. But sometimes it's faster to just click through the app and have the system learn from it.
Playwright's built-in codegen records clicks but produces brittle selectors and zero assertions β€” it's a starting point at best.

Proposed Solution

Add a Record Mode to Specter. The user clicks through their app manually, and the system:

  1. Captures every action (click, fill, select, navigate) with DOM snapshots
  2. Feeds the recording buffer into a new recordingAnalyst agent that groups raw events into logical test scenarios
  3. Pipes those scenarios through the existing scenarioWriter β†’ scriptWriter pipeline to enrich them with assertions, edge cases, and self-healing selectors

Architecture

User clicks in browser ↓ browserExecutor (mode: 'record') β†’ captures {action, target, selector, timestamp, domSnapshot} ↓ Recording Buffer (in-memory array) ↓ recordingAnalyst agent β†’ groups raw steps into logical scenarios ↓ scenarioWriter β†’ enriches with assertions + validation ↓ scriptWriter β†’ generates executable steps

Implementation Notes

  • browserExecutor.js already attaches page.on('console'), page.on('requestfailed'), page.on('response') listeners. Adding page.on('click'), page.on('input') in a mode: 'record' branch is natural.
  • New file: agents/recordingAnalyst.js β€” converts raw DOM events into structured scenarios
  • UI needs a "Record" toggle button next to the existing "RUN AGENT" button
  • Recording buffer should be capped (e.g., 200 actions max) to prevent memory issues

Which Agent / Component Does This Affect?

  • Browser Executor
  • Scenario Writer
  • Script Writer
  • Code Analyst
  • Route Navigator
  • Selector Expert
  • Verifier / Step Fixer
  • Cache / SQLite layer
  • UI / Client
  • Configuration / Settings
  • Other: New recordingAnalyst.js agent

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions