Heal

SDK overview

How Heal integrates with Playwright to write stable tests in natural language.

What the Heal SDK is

Heal is an SDK that lets you write stable end-to-end tests using natural language on top of Playwright. Under the hood, Heal still runs your tests through Playwright, so you keep all of Playwright’s power while gaining a higher-level, intent-based API for navigation and assertions.

Drop‑in replacement for Playwright actions

Heal SDK calls are designed to be a drop‑in replacement for many direct Playwright actions. Where you would normally write:

await page.click('text=Sign in');
await page.fill('input[name="email"]', 'user@example.com');

with Heal you can instead write:

const { page, agent } = await Heal.init(/* options */).getPage();

await agent.healClick('the "Sign in" button');
await agent.healType('the email field', 'user@example.com');

The rest of your test structure — fixtures, configuration, test runner setup — can remain the same.

Caching

Under the hool, heal calls ground elements, and dynamically find stable locators to cache. LLMs are called only when locators break, which makes Heal more stable and faster.

Mix and match

You can mix and match playwright and heal calls:

const { page, agent } = await heal.getPage();

// A Heal call
await healAgent.leftClick('The contact doctor button in the first card on the left');

// A playwright expect
await expect(page).toHaveURL(/doctor/);

This means you can:

  • Adopt Heal gradually in specific flows or files.
  • Keep using existing Playwright helpers, fixtures, and plugins.
  • Reach for raw Playwright whenever you need low-level control.

For full API details and supported patterns, see the SDK reference.

Next steps

On this page