Skip to content

defineConfig

defineConfig(config): ExtendedScreenCIConfig

Defined in: config.ts:66

Defines a screenci configuration file.

Extends Playwright’s config with screenci-specific options and enforces settings required for reliable video recording. Some Playwright options are locked and cannot be set — workers, fullyParallel, retries, testDir, and testMatch. Attempting to set them throws at startup.

ScreenCIConfig

screenci configuration options

ExtendedScreenCIConfig

Extended Playwright configuration with enforced sequential execution settings

Minimal — all options have sensible defaults:

import { defineConfig } from 'screenci'
export default defineConfig({})

Full config:

import { defineConfig } from 'screenci'
export default defineConfig({
projectName: 'my-project',
videoDir: './videos',
use: {
baseURL: 'https://app.example.com',
recordOptions: {
aspectRatio: '16:9', // '16:9' | '9:16' | '1:1' | '4:3' | ...
quality: '1080p', // '720p' | '1080p' | '1440p' | '2160p'
fps: 30, // 24 | 30 | 60
},
trace: 'retain-on-failure',
sendTraces: true,
},
})