Installation
Installation
Prerequisites
Before installing Autowright, ensure you have:
- Node.js 18.x or higher
- npm, pnpm, or yarn
- A project directory
Install Packages
npm install @korvol/stepwright @korvol/fixwrightpnpm add @korvol/stepwright @korvol/fixwrightyarn add @korvol/stepwright @korvol/fixwrightStepwright includes Playwright as a peer dependency. If you don’t have it installed:
npm install playwrightnpx playwright install chromiumVerify Installation
Create a test file to verify everything works:
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:
npx tsx test-install.tsIf 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:
ANTHROPIC_API_KEY=your-api-key-hereGITHUB_TOKEN=your-github-token # OptionalTypeScript Configuration
If using TypeScript, ensure your tsconfig.json includes:
{ "compilerOptions": { "target": "ES2022", "module": "ESNext", "moduleResolution": "bundler", "esModuleInterop": true, "strict": true }}Next Steps
Now that you’re set up:
- Quick Start - Write your first script
- Concepts - Learn the core concepts