Playwright Test wrapper with Stably AI matchers
Code. Ship. Test.
This package extends Playwright to add new AI functionality.
To get started quickly, please see AI-assisted setup guide. Otherwise continue to read below.
We assume you already have Playwright installed. If so you can run:
``shell`
npm install @stablyai/playwright-test
Make sure you also get your api-key to use the AI features.
Either set the STABLY_API_KEY environment variable or programtically call setApiKey from "@stablyai/playwright-test"
1. Replace "@playwright/test" with "@stablyai/playwright-test"
1. Ex: imports should look like: import { test, expect } from "@stablyai/playwright-test";
2. Simply run tests with npx playwright test as you would normally using Playwright
The SDK adds new methods with AI visual assertions, full agent mode, and text extraction. See our docs for more information.
The Stably Playwright Reporter also comes bundled with this package. Most users will find value in using this reporter for recording test results and having AI diagnostics.
First, ensure you have your STABLY_API_KEY (secret). If you don't have it, you can get it here.
Second, ensure that you have your Stably project ID (not a secret). You can get this from your web-app dashboard under settings
In your playwright.config.ts/js file add:
`typescript
import { defineConfig } from '@playwright/test';
import { stablyReporter } from '@stablyai/playwright-test';
export default defineConfig({
..., // your other config options go here
reporter: [
..., // (optional) other reporters go here
stablyReporter({ apiKey: process.env.STABLY_API_KEY, projectId: 'abc123' }), // ๐ Stably Reporter
]
})
``