mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-25 18:34:29 +08:00
Postman Collection
This directory contains the Postman collection for all Hyperswitch supported connectors and this documentation talks about how to build the collection.
Development of collections
Prerequisites
- Postman
- Newman CLI fork from npm: npm install -g 'https://github.com/knutties/newman.git#feature/newman-dir'
Steps to build the collection
stripe.postman_collection.jsonis the most up-to-date collection that consists of all the features that Hyperswitch supports- It is recommended that you use the
stripe.postman_collection.jsonas the base collection to build the collection for other connectors - If you developed a new feature, make sure you add them to the
stripe.postman_collection.jsongiven that it is a core feature. If it is collection specific, add it to the respective collection
- The collection consists of many directories and each directory consists of a set of requests. Each directory is a feature and each request is a test case
- The directory name should be the name of the feature and the request name should be the name of the test case
- If the feature that you add is a flow test case, make sure you add the test case to the
Flow Testcasesdirectory. If you did a refactor that handles errors say, expiry date of a card, make sure you add the test case to theVariation Casesdirectory prefixed byScenario-<number>where<number>is the number of the scenario - If the feature that you add is a core feature, make sure you add the test case to the
Happy Casesdirectory where only the happy cases are tested.
- Make sure that you update the
testssection where the necessaryjavascriptcode has to written/updated to test the feature (assertion checks where you verify the results obtained with the expected outcome) - If certain
testsneed to be run at the time of making a request, make sure you add them to thePre-request Scriptsection of the request - Make sure that the request body does not contain any comments else the
newman dir-exportcommand will fail which is used to export the collection to its directory structure
- After all the development is done, make sure you right click and run the collection in respective environments to make sure that the collection runs successfully
- Export the collection as
v2.1and save itpostman/collection-jsondirectory with file name following the format<connector_name>.postman_collection.json - Export the postman-collection to its directory structure by using the command
newman dir-export /path/to/collection.jsonand move the folder topostman/collection-dir(for more info, refer to Newman-Fork) with the folder renamed with name of the connector - You can run the postman collection from directory structure by referring here