> ## 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.

# Migrate Classic Tests to Agent 2.0

> Migrate your Classic (no-code) tests to Agent 2.0 — the Stably Web Editor with Git-backed version control.

Migrate your Classic tests to Agent 2.0. Your tests become Playwright-compatible code stored in a Git repository (either your own or Stably-managed) while keeping the same visual editing experience.

## Why migrate

The modern Stably platform replaces classic no-code tests with real Stably-powered Playwright code, smarter AI agents, and dramatically lower costs. Teams that migrate typically see **50–80% lower AI costs** — because tests are resilient from the start and don't need constant runtime auto-healing.

<Card title="Full comparison: Classic vs Web Editor + CLI" icon="scale-balanced" href="/no-code-tests/why-migrate">
  See the detailed benefits breakdown — cost savings, smarter autofix, less flakiness, and more.
</Card>

**In short:**

* **[Same visual editing](/stably2/web-quickstart)** — continue building tests without code using the Web Editor
* **Git-backed storage** — tests are stored as Playwright code in addition to a no-code version, enabling version control, code review, and edit anywhere
* **[Full Stably SDK](/getting-started/stably-playwright-sdk)** — access all AI features including AI assertions, AI actions, and autofix
* **[Run anywhere](/stably-cli/run-tests)** — execute tests in Stably Cloud, your CI/CD, or locally
* **[50–80% lower costs](/no-code-tests/why-migrate)** — no more runtime auto-heal burning through credits on every run

<Note>
  Migrated tests use the [Stably SDK](/getting-started/stably-playwright-sdk) which is 100% Playwright-compatible. You can continue using the visual Web Editor or work directly with the code.
</Note>

## Migration options

<Tabs>
  <Tab title="AI-Powered Migration (Recommended)">
    Let an AI agent migrate your Classic tests directly into your connected repository with automatic compatibility fixes.

    [Open **Settings → Export**](https://app.stably.ai/settings?tab=export) in the Stably dashboard and follow the instructions there.
  </Tab>

  <Tab title="ZIP Export">
    Download all your test suites as a ZIP file for manual integration.

    [Open **Settings → Export**](https://app.stably.ai/settings?tab=export) in the Stably dashboard and follow the instructions there.
  </Tab>
</Tabs>

## After migration

Once migrated, your tests are accessible in multiple ways:

<AccordionGroup>
  <Accordion title="Continue with the Web Editor">
    Open any test in the [Web Editor](/stably2/web-quickstart) to continue editing visually, just like Classic but with Git-backed version control.
  </Accordion>

  <Accordion title="Use the Stably CLI">
    Generate new tests or modify existing ones from your terminal:

    ```bash theme={null}
    npx stably create "Add a test for checkout flow"
    ```
  </Accordion>

  <Accordion title="Run tests anywhere">
    ```bash theme={null}
    # Run in Stably Cloud
    npx stably test

    # Run locally with Playwright
    npx playwright test

    # Run in your CI/CD
    # Tests work with any CI platform
    ```
  </Accordion>

  <Accordion title="Edit in your IDE">
    Since tests are stored as Playwright code in your repository, you can edit them directly in VS Code, Cursor, or any editor. Changes sync to the Web Editor automatically.
  </Accordion>
</AccordionGroup>

## What gets migrated

The migration converts your Classic tests to clean Playwright TypeScript:

| Classic Feature | Migrated Result                                          |
| --------------- | -------------------------------------------------------- |
| Test steps      | Playwright actions (`page.click()`, `page.fill()`, etc.) |
| AI Actions      | `agent.act()` calls                                      |
| AI Assertions   | `expect(page).aiAssert()`                                |
| Variables       | TypeScript variables with runtime injection              |
| Custom code     | Preserved as-is                                          |
| Knowledge items | Exported as `knowledge.md`                               |

### Example migrated test

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

test('Login flow with AI validation', async ({ page }) => {
  await page.goto('https://app.example.com/login');
  await page.fill('[name="email"]', 'user@example.com');
  await page.fill('[name="password"]', 'securePassword123');
  await page.click('button[type="submit"]');

  // AI assertion validates the visual state
  await expect(page).aiAssert(
    'The dashboard displays user profile information and recent activity'
  );
});
```

## Troubleshooting

### Migration agent can't start

Ensure your repository is initialized. Go to **Agents** in the dashboard to set it up, or connect your own repo via **Settings > Git**.

### Unsupported flows

Some Classic features may not have direct equivalents. The migration agent will skip these with `test.skip()` and explain why. You can ask the agent to implement alternatives or fix them manually.

## Next steps

<CardGroup cols={2}>
  <Card title="Web Editor Guide" icon="browser" href="/stably/stably-web-editor">
    Learn the visual editor and AI assistance
  </Card>

  <Card title="Bring Your Own Repo" icon="code-branch" href="/stably2/bring-your-own-repo">
    Connect your existing GitHub repository
  </Card>

  <Card title="CLI Quickstart" icon="terminal" href="/stably-cli/quickstart">
    Generate and run tests from your terminal
  </Card>

  <Card title="SDK Overview" icon="code" href="/stably-sdk/overview">
    Explore all SDK features and capabilities
  </Card>
</CardGroup>
