Instructions for Playwright Test and TypeScript
Configuring your tests with Playwright Test and TypeScript
Not for use with personal data
- 
In the root level of your testing folder, install the
@axe-core/watcherpackage and all of its dependencies usingnpmor your preferred package manager (for example,yarnorpnpm).npm install --save-dev @axe-core/watcher - 
Create a
fixtures.tsfile alongside your existing Playwright Test tests. In this file, import theplaywrightTest()function from@axe-core/watcher:import { playwrightTest } from '@axe-core/watcher' const API_KEY = process.env.API_KEY! const { test, expect } = playwrightTest({ axe: { apiKey: API_KEY }, headless: false // Any other Playwright configuration you’d pass to chromium.launchPersistentContext() here }) export { test, expect } - 
In your test files, replace the imports for
testandexpectfrom Playwright Test with yourfixtures.tsfile:import { test, expect } from '@playwright/test' // Becomes: import { test, expect } from './fixtures'; - 
You're all done.
 
