Playwright Configuration Reference

Recommended playwright.config.ts settings for use with Donobu, including timeouts, reporters, parallel workers, and per-project configuration.

Donobu works with a standard playwright.config.ts. This page documents the settings that matter most when using Donobu.

import { defineConfig, devices } from 'donobu';

export default defineConfig({
  testDir: './tests',

  projects: [
    {
      name: 'chromium',
      use: { ...devices['Desktop Chromium'] },
    },
  ],

  // Increase timeout to accommodate multi-step AI flows
  timeout: 180_000,

  use: {
    // Capture screenshots and video for every test — used by Donobu Studio
    // and the self-healing evidence collection
    screenshot: 'on',
    video: 'on',
  },

  reporter: [
    ['list', { printSteps: true }],
    ['json', { outputFile: 'test-results/playwright-report.json' }],
    // Optional: for displaying a standard Playwright report with `npx playwright show-report`
    ['html', { outputFolder: 'playwright-report', open: 'never' }],
    // Optional: GitHub Actions summary
    ['github'],
  ],
});

Key settings

timeout

The default Playwright timeout is 30 seconds. For Donobu tests, 180 seconds (3 minutes) is a safe default. A single page.ai() call on the first run may execute many tool calls in sequence; if the timeout fires mid-flow, the test fails and the cache is never written.

Once the cache is populated, re-runs are much faster and rarely hit the timeout.

screenshot: 'on' and video: 'on'

Donobu uses screenshots internally (for AI context) regardless of this setting. Enabling them at the Playwright level ensures they are also captured by the standard Playwright reporter and attached to the HTML report, making it easier to diagnose failures.

reporter

The json reporter produces the playwright-report.json file consumed by the playwright-json-to-markdown and playwright-json-to-slack-json CLI tools used in CI pipelines. See CI/CD Integration.

Pre-authenticated browser state

Set a project-level storageState to start every test in an authenticated state:

export default defineConfig({
  projects: [
    {
      name: 'authenticated',
      use: {
        storageState: 'playwright/.auth/user.json',
      },
    },
    {
      name: 'unauthenticated',
      // No storageState — tests start logged out
    },
  ],
});

Generate playwright/.auth/user.json in a global setup file — see Playwright's authentication guide.

Parallel workers

Donobu is safe to run with multiple parallel workers. Each test gets its own browser context and flow ID, so there is no shared state between parallel tests. The cache files use OS-level file locking to prevent corruption when multiple workers write simultaneously.

export default defineConfig({
  workers: 4, // Run 4 tests in parallel
  // ...
});

Environment-specific configurations

Use Playwright's --config flag to point at different configuration files per environment:

# Staging
npx donobu test --config=playwright.staging.config.ts

# Production smoke tests
npx donobu test --config=playwright.prod.config.ts

Each config can set different baseURL, storageState, timeout values, and reporter destinations.