Skip to content

Installation

Installation

Prerequisites

Before installing Autowright, ensure you have:

  • Node.js 18.x or higher
  • npm, pnpm, or yarn
  • A project directory

Install Packages

Terminal window
npm install @korvol/stepwright @korvol/fixwright

Stepwright includes Playwright as a peer dependency. If you don’t have it installed:

Terminal window
npm install playwright
npx playwright install chromium

Verify Installation

Create a test file to verify everything works:

test-install.ts
import { Stepwright } from '@korvol/stepwright';
const script = Stepwright.create('Test Installation')
.step('Navigate', async (ctx) => {
await ctx.page.goto('https://example.com');
console.log('Title:', await ctx.page.title());
});
script.run().then(() => console.log('Success!'));

Run it:

Terminal window
npx tsx test-install.ts

If you see “Success!” and the page title, you’re ready to go!

Optional: Install Fixwright Dependencies

For AI-powered fixing with Fixwright, you’ll need:

  • Anthropic API key - Get one here
  • GitHub token (optional) - For automatic PR creation

Set up your environment:

.env
ANTHROPIC_API_KEY=your-api-key-here
GITHUB_TOKEN=your-github-token # Optional

TypeScript Configuration

If using TypeScript, ensure your tsconfig.json includes:

tsconfig.json
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"esModuleInterop": true,
"strict": true
}
}

Next Steps

Now that you’re set up: