@autowright/stepwright
Fluent API for building structured browser automation scripts with Playwright.
- Chain-based script building
- Checkpoints with retry boundaries
- Artifact capture (screenshots, traces, video)
- Multiple reporter support
Complete API documentation for both Autowright packages.
@autowright/stepwright
Fluent API for building structured browser automation scripts with Playwright.
@autowright/fixwright
AI-powered service that automatically fixes failing Stepwright scripts using Claude.
The runner framework for creating and executing automation scripts.
import { Stepwright, ConsoleReporter } from '@autowright/stepwright';
const script = Stepwright.create<{ token?: string }>('Login') .config({ headless: true, screenshotOnFailure: true }) .reporter(new ConsoleReporter()) .checkpoint('Authentication') .step('Navigate', async (ctx) => { await ctx.page.goto('https://example.com/login'); }) .step('Login', async (ctx) => { await ctx.page.fill('#email', 'user@example.com'); await ctx.page.click('#submit'); }) .endCheckpoint();
await script.run();The AI-powered fixer service for automatic script maintenance.
import { FixingLoop, FileFailureSource } from '@autowright/fixwright';
const source = new FileFailureSource('./failure-cases');const fixingLoop = new FixingLoop({ ai: { apiKey: process.env.ANTHROPIC_API_KEY! }, git: { baseBranch: 'main', fixBranchPrefix: 'fix/stepwright-' }, github: { token: process.env.GITHUB_TOKEN!, owner: 'org', repo: 'repo' }, fixing: { maxAttempts: 3 }, workDir: process.cwd(),}, source);
fixingLoop.on('attempt:success', (attempt) => { console.log('Fixed:', attempt.analysis?.explanation);});
fixingLoop.on('pr:created', (url) => { console.log('PR:', url);});
await fixingLoop.processFailure(failureCase);Both packages share common types from @autowright/shared:
import type { FailureCase, StepResult } from '@autowright/shared';Key shared types include:
FailureCase - Failure information passed from Stepwright to FixwrightStepResult - Result of a step execution