Test Runners
Playwright
Install the Playwright Plugin package into your project
Terminal
npm install @replayio/playwright@alpha -D
Note
We recommend using the current @alpha
version of this plugin. It's more robust and better but we are still polishing it. If you encounter any problems with it you can use @replayio/playwright@latest
. We'd appreciate feedback and bug reports to be reported here.
Update your configuration
playwright.config.ts
1import { PlaywrightTestConfig, devices } from '@playwright/test'2import {3 createReplayReporterConfig,4 devices as replayDevices,5} from "@replayio/playwright";6import 'dotenv/config'78const config: PlaywrightTestConfig = {9 reporter: [10 createReplayReporterConfig({11 apiKey: process.env.REPLAY_API_KEY,12 upload: true,13 }),14 ['line'],15 ],16 projects: [17 {18 name: 'replay-chromium',19 use: { ...replayDevices['Replay Chromium'] },20 },21 ],22}23export default config
Generate and save your API key
In order to upload your test replays you need to generate an API key and save it to your environment. You can generate an API key once you created a team in Replay App. API key management section can be found in the team settings menu. Read more about API keys here.
To use your API key, you can either use dotenv package and save it to a .env
file or add the API key to your environment directly.
.env
REPLAY_API_KEY=<your_api_key>
Record your test
Once you have added Chromium Replay Browser to your project, you are ready to create your recordings. You can run your tests normally, using npx playwright test
command.
If your project has multiple browsers set up, you can run Replay Browser only:
Terminal
npx playwright test --project replay-chromium
Terminal
โ npx playwright testRunning 1 test using 1 worker[1/1] things-app.spec.ts:14:7 โบ Todos โบ should allow me to add todo items[replay.io]: ๐ Completing some outstanding work ...[replay.io]:[replay.io]: ๐ Successfully uploaded 1 recordings:[replay.io]:[replay.io]: โ should allow me to add todo items1 passed (2.1s)
Integrate into your CI workflow
Replay is designed to record tests in CI so you can debug when tests fail. Without Replay, test failures in CI are like a black box, with little insights into what went wrong. By recording with Replay, you get a full recording of the test run with debugging tools built in.
Here are basic configurations for some of the most popular providers which you can add to you project
Done!
Youโre ready to inspect your local test run in Replay DevTools now. You can also record your tests in your CI environment. Learn how to set up Replay with your Cypress tests on GitHub Actions and other CI providers.
Check out this replay for a detailed walkthrough on debugging a flaky Playwright test. You'll see the capabilities of Replay DevTools and walk through the debugging process of identifying the root cause.
Learn how to record your tests, manage your test suite and debug flaky tests using Replay DevTools
Record Your CI Test Run
Learn how to integrate Replay into your Continuous integration service
Replay DevTools
Learn how to use Replay DevTools to debug your tests.
Test Suite Management
Test Suite Dashboard helps you stay on top of your test suite health.
Debugging tips
Learn about how to effectively debug flaky or failing tests