Postman Collection Run - How to Test File Uploading API on CircleCi or Jenkins
From last couple of days, I was doing R&D on how we can test file uploading API on CircleCi or Postman collection Run?
Finally, I found a way to test the File uploading APIs using the Postman Desktop app OR Postman CLI collection run.
I have also tested this solution, even on CircleCi for running the automated testing postman APIs by Postman CLI collection run.
Here is step by step process, how you can test the file uploading API on CircleCi or Postman collection Run?
Local Desktop App settings:
- Open and go to Local Postman app settings -> General
- Set working directly location (default is postman installation directory but can also choose any other directory)
- Place files (to use in file upload APIs during the collection run) in the working directory selected as in the above step and also in the root directory of your project.
- Now go to the API in which you need to upload a file, and select the file from the working directory selected in step 2.
- Save that API and collection.
CircleCi or Jenkins Postman command
- Now update the command to run postman collection in .circleci/config.yml like
postman collection run postman/ci-collection.json --working-dir [project-root-directory]
where project-root-directory can be /var/www/html when using docker.
Now the upload API should run normally for collection run on local Postman App and on CircleCi as well.
In case you still face any issue, please comment below, I will try to help you as soon as possible.
Note: Please keep your Postman App and CLI updated.
Comments
Post a Comment