Seamless Integration
Existing Playwright Code Works Unchanged
Your existing Playwright tests work out of the box with Stably SDK:Zero Breaking Changes
All Playwright APIs are fully supported:- Page interactions:
click()
,fill()
,selectOption()
, etc. - Assertions: All
expect
matchers work identically - Configuration:
playwright.config.ts
files work unchanged - Test runners:
npx playwright test
commands work the same, though we recommend usingnpx stably test
command for additional auto-healing capabilities - Fixtures: Custom fixtures and page objects work unchanged
Enhanced Capabilities with AI
While maintaining full compatibility, Stably SDK adds AI-powered features:AI-Powered Assertions
Self-Healing Tests
Tests automatically adapt to UI changes:Perform complex actions with AI
Integration Steps
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
:4
Update Imports
Replace all imports from
@playwright/test
with @stablyai/playwright-test
:5
Enable AI Auto-Heal (Optional)
To enable AI auto-heal capabilities, create a
stably.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
6
Add Stably CI Reporter (Optional)
To integrate with Stably’s cloud platform and view test results in the dashboard:Install the reporter package:Configure the reporter in your Set environment variables:
playwright.config.ts
:playwright.config.ts
- Get your Team API Key from Stably Settings
- Find your Project ID in your project settings on the Stably Dashboard
Performance Benefits
- Reduced flakiness with self-healing capabilities
- Better debugging with AI-generated test insights
- Automatic maintenance of test suites via our auto-maintainance agents