logo

Recording Puppeteer (Experimental)

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

  • Use the getExecutablePath function to designate which browser (currently only โ€chromiumโ€) to use to record the test. This should be called within the puppeteer.launch() options object as the executablePath 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

javascript
const 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


Powered by Notaku