logo

Test run command

Your existing test run command (for example, npx playwright test) must be updated to include the name of a Replay Browser and required environment variables to record.
You should make this update wherever your run command is defined, typically in package.json or directly in the workflow file.

Cypress

Adding @replayio/cypress and configuring your project gives access to two additional browser names:
  • โ€œReplay Firefoxโ€ (macOS, Linux)
  • โ€œReplay Chromiumโ€ (Linux only)
Pass the following with your run command to record with Replay:
  • RECORD_REPLAY_METADATA_FILE=$(mktemp)
  • RECORD_ALL_CONTENT=1 if using โ€œReplay Firefoxโ€
  • --browser "Browser Name"
For example, to record with โ€œReplay Firefoxโ€, use the following command:
yaml
RECORD_ALL_CONTENT=1 RECORD_REPLAY_METADATA_FILE=$(mktemp) npx cypress run --browser "Replay Firefox"
If you donโ€™t specify a browser, the Cypress default Electron will be used.

Playwright

Adding @replayio/playwright and configuring your project creates Playwright projects for specifying a browser.
  • replay-firefox (macOS, Linux)
  • replay-chromium (Linux only)
Pass the following flags to your run command:
  • --project project-name
  • --reporter=@replayio/playwright/reporter,line
For example, to use Replay Firefox, the command is:
javascript
npx playwright test --project replay-firefox --reporter=@replayio/playwright/reporter,line
If you donโ€™t specify a project, all projects defined in your config will run.

Helpful?