postman-to-cypress
v1.0.3-Canary.1
Published
This package will be able to consume postman collection
Downloads
19
Maintainers
Readme
Postman to Cypress Converter
This tool converts Postman collections and environments into Cypress test files. It reads a Postman collection and environment JSON file, processes the items and variables, and generates Cypress test files in a specified output directory.
Features
- Converts Postman collections to Cypress tests
- Saves the converted environment variables to a cypress.env.json file.
- Resolves environment variables in requests
- Supports custom output directories and file naming conventions.
Usage
Prepping your collection and environment files
DON'Ts
[!CAUTION]
- Nesting of collections into multiple directory as shown below
- Naming request as endpoint complete path or uri
- Refrain from complex request chaining
folder
├── folder
│ ├── collection
│ └── collection
└── folder
├── collection
├── collection
└── folder
├── collection
├── collection
├── collection
└── folder
├── collection
├── collection
└── collection
DOs
[!TIP]
- Nest collection in the single
directory/folder
as shown below- Name
request/collection
as intended functionality wish
folder (testsuite name: "Suite for Sales Endpoint")
├── collection (testcase name: "Get Address")
├── collection
└── collection
Converting Postman Collection/Environment
to Cypress Test/Cypress.env.json
:coffee: Installation
npm i -g postman-to-cypress
:point_right: Help
pcy -h
:point_right: To Convert Collection/Collection Variables
pcy convert -c /user/collection -cy
:point_right: To Convert Collection/Collection Variables and Providing a Directory
pcy convert -c /user/collection -cy --output [directory]
:point_right: To Convert Collection with Default Output Directory (Cypress/Integration)
pcy convert -c /user/collection -e /user/environment -cy
:point_right: To Convert Collection and Providing a Directory
pcy convert -c /user/collection -e /user/environment -cy --output [directory]
:point_right: To Generate Cypress.env.json
from Environment File
pcy generate-env -e /user/environment --output [directory]
For more information on how to use Cypress.env()
for API testing see
Contribution guidelines for this project
Requirements
- Node.js (>= 20.x)
- npm (>= 10.x)
License
postman-to-cypress is MIT Licensed