@stablyai/playwright-test
v2.0.5
Published
Playwright Test wrapper with Stably AI matchers
Keywords
Readme
Stably Playwright 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.
Installation
We assume you already have Playwright installed. If so you can run:
npm install @stablyai/playwright-testSDK
Setup
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"
Usage
- Replace "@playwright/test" with "@stablyai/playwright-test"
- Ex: imports should look like: import { test, expect } from "@stablyai/playwright-test";
- Simply run tests with
npx playwright testas you would normally using Playwright
New Methods
The SDK adds new methods with AI visual assertions, full agent mode, and text extraction. See our docs for more information.
Stably Playwright Reporter
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.
Setup
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:
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
]
})