Package Exports
- @cypress/chrome-recorder
- @cypress/chrome-recorder/dist/main.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@cypress/chrome-recorder) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@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.