Monday, July 10, 2017

Testing: Postman and Swagger As Additions to Your Tests

Often I need to queue up some unit tests on-the-fly. I recently came across the following helpers:

1.  CREATE POSTMAN API TESTS FROM SWAGGER

In case anyone else did not know, it is now an option to take the swagger document from your WebAPI, import it into Postman and, voila, test cases for controllers created.   


1.      Create swagger.json from API
2.      Open Postman
3.      Navigate to "Import" button

4.      Open swagger.json file (or paste, etc)

2.  RUN POSTMAN TESTS FROM VISUAL STUDIO

Postman Runner for VSCode allows you to run Postman tests from your VSCode. It analyze the workspace folder and locate collection and environment files.
  • Export your Postman collections and environments in a folder (or subfolders) and open it with VSCode.
  • Open the Command Palette
  • Choose Postman: Run > Question Mode ( Ctrl+Q , Cmd+R )

https://marketplace.visualstudio.com/items?itemName=eridem.vscode-postman




No comments:

Post a Comment