Installation & Setup
1
Remove existing Playwright (if installed)
If you already have Playwright installed:
2
Install Stably Playwright SDK
Navigate to your e2e tests directory (the one that previously had the
@playwright/test
dependency):3
Setup API Key
Get a Team API Key from your Stably Settings and set it as an environment variable:
The tests will expect
process.env.STABLY_API_KEY
, but you can also programmatically set a key using the setApiKey
function from @stablyai/playwright-test
:Usage
1. Update Your Code
Replace all imports from@playwright/test
with @stablyai/playwright-test
:

2. Run Tests
Use the same Playwright commands you’re already familiar with:- Run tests in headed mode:
npx playwright test --headed
- Run a specific test file:
npx playwright test tests/example.spec.ts
- Run tests in UI mode:
npx playwright test --ui
- Run a single project/browser:
npx playwright test --project=chromium
3. Enable AI Auto-Heal (Optional)
To enable AI auto-heal capabilities, create astably.config.ts
file in the same folder as your playwright.config.ts
:
Model support: Stably currently supports only
claude-sonnet-4-5
for auto-heal functionality. This model has demonstrated the best accuracy and reliability for both locator and screenshot healing. We plan to expand support for additional models in the future.stably.config.ts
4. Add Stably CI Reporter (Optional)
To integrate with Stably’s cloud platform and view test results in the dashboard:1
Install the reporter package
2
Configure the reporter
Add the Stably reporter to your
playwright.config.ts
:playwright.config.ts
3
Set environment variables
Export the required environment variables:
- Get your Team API Key from Stably Settings
- Find your Project ID in your project settings on the Stably Dashboard
Prefer a no-code approach?
If you don’t want to manage Playwright configuration, runners, and maintenance yourself, you can use Stably’s no-code AI tests to get the same capabilities—AI test generation, AI assertions, AI actions, and auto-heal—running on our scalable cloud platform without writing code.- Same power, simpler UX: Built on top of Playwright, with a streamlined editor UI.
- AI-first: Natural-language test generation, AI assertions, AI actions, and self-healing.
- Cloud-native: Record, run, and triage at scale with zero local setup.
- Portable: Export tests to Playwright anytime if you need advanced customization.
Quick start (no-code)
- Sign in to the Stably Dashboard: Open Dashboard.
- Create a project and open the recorder in the no-code editor.
- Record steps or use AI to generate them in the editor: see No-code Editor.
- Add intelligence to your test with AI Assertions and AI Actions. Auto-healing is available out of the box: see Auto-Heal.
- Run in the cloud and review results: see Viewing Run Results and Test Results.
The no-code editor is Playwright-compatible under the hood. You can export tests to Playwright at any time and continue in code when you need more advanced workflows. Learn more in Full Playwright Compatibility.