Replay Puppeteer is a drop-in replacement for standard Puppeteer.
Replay is up-to-date as of Puppeteer version 13.3.1. If you are using a newer version and run into a problem, please open a GitHub issue here to let us know!
Setup
- Install
@replayio/puppeteer
withnpm i @replayio/puppeteer
in your project.
- Use the
getExecutablePath
function to designate which browser (currently onlyโchromiumโ
) to use to record the test. This should be called within thepuppeteer.launch()
options object as theexecutablePath
property value (see example below).
Replay Puppeteer only supports Chrome (beta) on Linux at this time.
Usage
Write your test script and execute the test file as usual, and the Replay-enabled browser will be used and generate a replay of the test run.
Example
javascriptconst puppeteer = require("puppeteer"); const { getExecutablePath } = require("@replayio/puppeteer"); (async () => { const browser = await puppeteer.launch({ headless: false, executablePath: getExecutablePath("chromium"), }); const page = await browser.newPage(); await page.goto("https://replay.io"); await page.screenshot({ path: "replay.png" }); await page.close(); await browser.close(); })();
After recording, you can view the available recordings with
npx @replayio/replay ls
and upload with npx @replayio/replay upload <id>
.Notes
- See the complete Replay CLI guide for details on how to view and upload replays.