Skip to content

Configuration Reference

Configuration Reference

This page documents all configuration options for Stepwright and Fixwright.

Stepwright Configuration

Complete Config Interface

interface StepwrightConfig {
// Browser settings
headless?: boolean;
browser?: 'chromium' | 'firefox' | 'webkit';
launchOptions?: LaunchOptions;
// Timeouts
defaultTimeout?: number;
navigationTimeout?: number;
// Viewport
viewport?: {
width: number;
height: number;
};
// Artifacts
screenshotOnFailure?: boolean;
domOnFailure?: boolean;
consoleOnFailure?: boolean;
artifactDir?: string;
// Video recording
video?: {
enabled: boolean;
dir?: string;
size?: { width: number; height: number };
};
// Logging
verbose?: boolean;
}

Browser Settings

headless

Run browser without visible UI.

TypeDefaultRequired
booleantrueNo
.config({
headless: false, // Show browser window
})

browser

Browser engine to use.

TypeDefaultRequired
'chromium' | 'firefox' | 'webkit''chromium'No
.config({
browser: 'firefox',
})

launchOptions

Playwright browser launch options.

TypeDefaultRequired
LaunchOptions{}No
.config({
launchOptions: {
slowMo: 100, // Slow down actions
devtools: true, // Open DevTools
args: ['--no-sandbox'], // Chrome flags
},
})

Timeouts

defaultTimeout

Default timeout for all operations in milliseconds.

TypeDefaultRequired
number30000No
.config({
defaultTimeout: 60000, // 60 seconds
})

Timeout specifically for navigation operations.

TypeDefaultRequired
number30000No
.config({
navigationTimeout: 120000, // 2 minutes for slow pages
})

Viewport

viewport

Browser viewport size.

TypeDefaultRequired
{ width: number; height: number }{ width: 1280, height: 720 }No
.config({
viewport: {
width: 1920,
height: 1080,
},
})

Artifacts

screenshotOnFailure

Automatically capture screenshot when a step fails.

TypeDefaultRequired
booleantrueNo
.config({
screenshotOnFailure: true,
})

domOnFailure

Capture DOM HTML when a step fails.

TypeDefaultRequired
booleanfalseNo
.config({
domOnFailure: true,
})

consoleOnFailure

Capture browser console logs when a step fails.

TypeDefaultRequired
booleantrueNo
.config({
consoleOnFailure: true,
})

artifactDir

Directory for storing artifacts.

TypeDefaultRequired
string'.stepwright/artifacts'No
.config({
artifactDir: './test-artifacts',
})

Video Recording

video

Video recording configuration.

TypeDefaultRequired
VideoConfigundefinedNo
.config({
video: {
enabled: true,
dir: './videos',
size: { width: 1280, height: 720 },
},
})

Logging

verbose

Enable verbose logging.

TypeDefaultRequired
booleanfalseNo
.config({
verbose: true,
})

Fixwright Configuration

Complete Config Interface

interface FixWrightConfig {
// AI Configuration
ai: {
apiKey: string;
model?: string;
maxTokens?: number;
thinking?: {
type: 'enabled' | 'disabled';
budgetTokens?: number;
};
};
// Fixing behavior
maxAttempts?: number;
maxRetries?: number;
// Output
verbosity?: 'quiet' | 'normal' | 'verbose';
// File handling
backup?: boolean;
backupDir?: string;
// Git integration
git?: {
enabled: boolean;
createBranch?: boolean;
branchPrefix?: string;
commitMessage?: string;
};
// PR creation
pr?: {
enabled: boolean;
draft?: boolean;
labels?: string[];
assignees?: string[];
};
}

AI Configuration

ai.apiKey

Anthropic API key for Claude.

TypeDefaultRequired
string-Yes
new FixWright({
ai: {
apiKey: process.env.ANTHROPIC_API_KEY!,
},
})

ai.model

Claude model to use.

TypeDefaultRequired
string'claude-sonnet-4-20250514'No
new FixWright({
ai: {
apiKey: '...',
model: 'claude-sonnet-4-20250514',
},
})

ai.maxTokens

Maximum tokens for AI response.

TypeDefaultRequired
number16000No
new FixWright({
ai: {
apiKey: '...',
maxTokens: 32000,
},
})

ai.thinking

Extended thinking configuration.

TypeDefaultRequired
ThinkingConfig{ type: 'disabled' }No
new FixWright({
ai: {
apiKey: '...',
thinking: {
type: 'enabled',
budgetTokens: 10000,
},
},
})

Fixing Behavior

maxAttempts

Maximum fix attempts per failure.

TypeDefaultRequired
number3No
new FixWright({
ai: { apiKey: '...' },
maxAttempts: 5,
})

maxRetries

Maximum retries for failed attempts.

TypeDefaultRequired
number2No
new FixWright({
ai: { apiKey: '...' },
maxRetries: 3,
})

Output

verbosity

Log verbosity level.

TypeDefaultRequired
'quiet' | 'normal' | 'verbose''normal'No
new FixWright({
ai: { apiKey: '...' },
verbosity: 'verbose',
})

File Handling

backup

Create backup of original files before modification.

TypeDefaultRequired
booleantrueNo
new FixWright({
ai: { apiKey: '...' },
backup: true,
})

backupDir

Directory for backups.

TypeDefaultRequired
string'.fixwright/backups'No
new FixWright({
ai: { apiKey: '...' },
backupDir: './script-backups',
})

Git Integration

git.enabled

Enable Git integration.

TypeDefaultRequired
booleanfalseNo

git.createBranch

Create a new branch for fixes.

TypeDefaultRequired
booleantrueNo

git.branchPrefix

Prefix for created branches.

TypeDefaultRequired
string'fix/'No

git.commitMessage

Template for commit messages.

TypeDefaultRequired
string'fix: {description}'No
new FixWright({
ai: { apiKey: '...' },
git: {
enabled: true,
createBranch: true,
branchPrefix: 'fixwright/',
commitMessage: 'fix({script}): {description}',
},
})

PR Creation

pr.enabled

Enable automatic PR creation.

TypeDefaultRequired
booleanfalseNo

pr.draft

Create PR as draft.

TypeDefaultRequired
booleantrueNo

pr.labels

Labels to add to PR.

TypeDefaultRequired
string[]['fixwright', 'automated']No

pr.assignees

Assignees for the PR.

TypeDefaultRequired
string[][]No
new FixWright({
ai: { apiKey: '...' },
git: { enabled: true },
pr: {
enabled: true,
draft: false,
labels: ['automated-fix', 'needs-review'],
assignees: ['username'],
},
})

Configuration Files

stepwright.config.ts

Create a configuration file for shared settings:

stepwright.config.ts
import type { StepwrightConfig } from '@korvol/stepwright';
const config: StepwrightConfig = {
headless: process.env.CI === 'true',
screenshotOnFailure: true,
domOnFailure: true,
defaultTimeout: 30000,
artifactDir: './artifacts',
};
export default config;

fixwright.config.ts

fixwright.config.ts
import type { FixWrightConfig } from '@korvol/fixwright';
const config: FixWrightConfig = {
ai: {
apiKey: process.env.ANTHROPIC_API_KEY!,
model: 'claude-sonnet-4-20250514',
},
maxAttempts: 3,
verbosity: 'normal',
backup: true,
git: {
enabled: true,
branchPrefix: 'fix/',
},
};
export default config;

Next Steps