Skip to content

Introduction

Stepwright and Fixwright together form a browser automation ecosystem with two complementary packages: Stepwright for writing automation scripts and Fixwright for AI-powered script maintenance.

The Problem

Browser automation tests are notorious for breaking. Selectors change, pages get redesigned, timing issues occur. Maintaining automation scripts can take more time than writing them.

The Solution

Two packages that work together:

Stepwright

A fluent API for writing readable, maintainable automation scripts with built-in checkpoints, retries, and rich failure context capture.

Fixwright

An AI-powered service that automatically detects why scripts fail and creates pull requests with fixes using Claude AI.

How It Works

┌─────────────────────────────────────────────────────────────┐
│ STEPWRIGHT │
│ Write scripts → Run → Capture failure context on error │
└─────────────────────────────┬───────────────────────────────┘
│ FailureCase (trace, screenshot, DOM)
┌─────────────────────────────────────────────────────────────┐
│ FIXWRIGHT │
│ Read failures → AI analysis → Create fix → Open PR │
└─────────────────────────────────────────────────────────────┘
  1. Write scripts with Stepwright - Use the fluent API to create automation scripts
  2. Run scripts - Execute scripts with artifact capture enabled
  3. When scripts fail - Stepwright captures screenshots, DOM, traces, and error details
  4. Fixwright analyzes failures - AI examines the failure and proposes fixes
  5. Automatic PR creation - Fixes are committed and PRs are created for review

Package Comparison

FeatureStepwrightFixwright
PurposeRun automation scriptsFix failing scripts
LifecycleEphemeral (runs and exits)Long-lived service
Requires PlaywrightYesNo
Requires AI API keyNoYes (Anthropic)
Creates PRsNoYes (optional)

Key Features

Stepwright Features

  • Fluent API - Chain steps together for readable scripts
  • Checkpoints - Group steps with automatic retries
  • Data Management - Pass data between steps
  • Trace Recording - Full Playwright traces on failure
  • Video Recording - Optional video capture
  • DOM Snapshots - Capture page state at failure

Fixwright Features

  • AI Analysis - Claude AI analyzes failures using screenshots, traces, and code
  • Automatic Fixes - Generates and applies code fixes
  • Git Integration - Creates branches and commits
  • PR Creation - Opens pull requests with fix explanations
  • Validation - Runs fixed script to verify the fix works

Next Steps