> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stably.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Stably SDK Overview

> Playwright-compatible SDK that powers the Stably CLI and Web Editor with AI-assisted testing.

<Info>
  Stably SDK is the engine behind both [Stably CLI](/stably-cli/commands) and [Stably Web Editor](/stably/stably-web-editor) — the same Playwright-compatible runtime executes your tests in code and no-code workflows.
</Info>

<Info>
  Stably is **100% 🎭 Playwright-compatible**: keep your `playwright.config.*`, fixtures, locators, and CLI habits while layering in AI assertions, actions, and self-healing.
</Info>

Stably SDK extends the Playwright test runner with AI capabilities while keeping your existing tests, fixtures, and configuration intact. Use it as a drop-in import to gain AI assertions, AI actions, and self-healing without rewriting your suite.

## Keep Playwright, Add Stably

* Works with your current `playwright.config.*`, fixtures, and `expect` matchers
* Supports standard commands like `npx playwright test`; use `npx stably test` to enable auto-heal and richer triage
* No breaking changes to page interactions, locators, or custom utilities

```typescript theme={null}
import { test, expect } from '@stablyai/playwright-test';

test('UI flows stay Playwright-compatible', async ({ agent, page }) => {
  await page.goto('https://example.com');
  await expect(page.locator('text=Success')).toBeVisible();

  // AI add-ons
  await expect(page).aiAssert('Shows a success state with a green confirmation banner');
  await agent.act('Open the first pending request and approve it', { page });
});
```

## AI Capabilities at a Glance

* **AI-powered assertions**: Intent-based visual checks with `aiAssert`.
* **Agent actions**: Natural-language flows that handle multi-step UI work.
* **Visual extraction**: Pull structured data from rendered pages with `page.extract()`.
* **Email inbox**: Receive emails and extract OTPs, magic links, or custom data with `inbox.extractFromEmail()`.
* **Auto-maintenance**: Keeps locators stable and reduces flakes as your app evolves.

## Getting Started

<Note>
  Follow the [SDK Setup Guide](/getting-started/sdk-setup-guide) to install the package, swap in the Stably runner import, and enable AI features.
</Note>

## Adopt Gradually

* Start by running existing tests with the Stably import to validate compatibility.
* Migrate critical journeys first, then layer on AI assertions and actions where they reduce flaky maintenance.
* Keep your preferred Playwright versioning and tooling; Stably fits into your current CI, CLI, and editor workflows.
