Introduction

What Donobu is and how it extends Playwright with AI-driven test automation and self-healing capabilities.

At its core, Donobu is a drop-in extension for Playwright that adds AI-driven test automation to your existing test suite. It augments the standard Playwright Page object with new methods — most importantly page.ai() — that let you write browser tests in plain English rather than hand-coding every click, input, and assertion.

What problem does it solve?

Standard Playwright tests are brittle: a renamed button, a new modal, or a restructured form can break a dozen tests at once. Maintaining a large Playwright suite often means spending as much time updating tests as writing new ones.

Donobu addresses this in two ways:

  1. AI-Driven Execution — Instead of prescribing every step, you describe the goal. The AI figures out how to accomplish it using the current state of the page.
  2. Self-Healing — When a test breaks due to a UI change, Donobu can automatically generate a new action sequence and update the test cache, so the next run passes without manual intervention.

How it relates to standard Playwright

Donobu is not a replacement for Playwright — it is an extension. You still write Playwright tests, use Playwright's expect library, and configure playwright.config.ts. The only difference is your test import, how you run your tests, and a richer page object.

// Before
import { test, expect } from '@playwright/test';

// After — everything else stays the same
import { test, expect } from 'donobu';

To run your tests, use npx donobu test instead of npx playwright test. All Playwright CLI arguments are supported, and Donobu adds its own — see the CLI Reference for details.

All standard Playwright APIs remain available. Donobu adds new methods on top; it does not remove or break existing ones.

Key capabilities

CapabilityWhat it does
page.ai(instruction)Runs an autonomous AI flow that navigates and interacts with the browser to fulfil a plain-English goal
page.ai(instruction, { schema })Same as above, but returns structured data validated against a Zod schema
page.ai.assert(condition)Asserts a natural-language condition about the current page state
page.ai.extract(schema)Reads structured data from the current page without running a full autonomous flow; schema is a Zod schema
page.find(selector, { failover })Smart locator that tries backup selectors automatically if the primary one fails
page.changeTab(url)Switches focus to another open tab while keeping the same AI flow context
page.runAccessibilityTest()Runs an axe-core accessibility audit and returns structured results
CachingFirst-run AI decisions are cached and replayed on subsequent runs, making them fast and cost-free.
Self-healingDetects broken tests and repairs them automatically by regenerating the cached action sequence.

How it relates to Donobu Studio

Every test run produces a flow — a single execution of a test, with its own unique ID. All tool calls, screenshots, and metadata produced during the run are associated with that flow ID and are synced to Donobu Studio when running your tests locally.

The flow ID is a UUID generated fresh for each run (even for retries of the same test), which ensures no two runs overwrite each other's data. You can use the flow ID to locate a specific run in Donobu Studio, inspect the step-by-step action timeline, review screenshots, and diagnose failures.

When to use Donobu vs. plain Playwright

Use plain Playwright assertions and locators when you are testing a specific, stable UI contract (e.g. verifying an exact error message or a computed value). Use page.ai for higher-level flows — multi-step user journeys, forms with variable structure, or any interaction that would otherwise require frequent test maintenance.