@cypress/chrome-recorder
This repo provides tools to export Cypress Tests from Google Chrome DevTools' Recordings
Installation
$ npm install -g @cypress/chrome-recorder
Usage
Via CLI
To use the interactive CLI, run:
$ npx @cypress/chrome-recorder
The CLI will prompt you to enter the path of the directory or file that you would like to modify as well as a path to write the generated Cypress test to.
If you prefer to enter paths via the CLI, you can run the following command to export individual recordings:
$ npx @cypress/chrome-recorder <relative path to target test file>
or for folders containing multiple recordings:
$ npx @cypress/chrome-recorder <relative path to target test folder>/*.json
CLI Options
Option | Description |
---|---|
-f, --force | Bypass Git safety checks and force exporter to run |
-d, --dry | Dry run (no changes are made to files) |
-p, --print | Print transformed files to stdout, useful for development |
Note: Currently the output will be written to cypress/integration
. If you do not have that folder, create it or install Cypress by running yarn add -D cypress
or npm install --save-dev cypress
in your project.
Via Import
import { cypressStringifyChromeRecording } from '@cypress/chrome-recorder';
const stringifiedContent = await cypressStringifyChromeRecording(
recordingContent
);
return stringifiedContent;
License
This project is licensed under the terms of the MIT license.