Skip to content

Project open source financed by Madrid Digital (Spain) and CloudAPPi S.L and promoted by APIAddicts. With this project, you can generate all tests automatically using a Swagger document, and you can add it to CI using newman.

License

Notifications You must be signed in to change notification settings

benjagm/openapi2postman

 
 

Repository files navigation

contributors

CloudAPPi

CloudAppi is one leader in APIs in global word. See the CloudAPPi Services

Madrid Digital

Madrid Digital is a public administration in Spain. See the Comunidad de Madrid website

Openapi2postman

Openapi2postman creates automatic tests from Openapi 3.0 using postman format. Also, it creates environments files, depending of configuration. Those collections can be importend in postan application. The tests includes tests for 2xx, 4xx... and tests to validate output formats.

Table of content

Structure and submodules

  • docs - This module contents the guides to configurate and run the product.
  • example - Integration and system tests for SoapUI.
  • src – Source code
  • test - Testing folder

Build and run

Prerequisites

You need node v10 or later.

run

Please review the s2p_config_file.json before to execute the command Execute node index.js --configuration s2p_config_file.json --file example/swagger_provincias.yml

The output files are the following (in example folder):

  • SWAGGER_API_TestSuite_DEV.postman_collection.json
  • SWAGGER_API_TestSuiteEnv_DEV.postman_environment.json
  • SWAGGER_API_TestSuite_PROD.postman_collection.json
  • SWAGGER_API_TestSuiteEnv_PROD.postman_environment.json

In postman:

  • import generated postman collection file in postman

  • import generated postman environment file in postman

  • update variables in the envirnoment to test all cases

Get the source code for the first time

To get the source code, run git clone https://github.com/apiaddicts/openapi2postman.git in the folder where you want to clone the root folder of the Openapi2postman project.

Configuration file

Collections and environments to generate can be configured using a JSON configuration file. Collection and environment name can be specified, as well as the target folder for resulting files, the authorizations collection to be used and some other characteristics. This configuration file has an specification and examples that can be read on the following document:
Configuration file openapi2postman. This document is only available in spanish by now. it will be soon translated to english.

an example configuration file is included in file structure.

Workspace configuration

Node.js and npm package manager are required to run the tool. Its adviced to use preconfigured installation tools provided by the manufacturer: https://nodejs.org/es/download/

About

Project open source financed by Madrid Digital (Spain) and CloudAPPi S.L and promoted by APIAddicts. With this project, you can generate all tests automatically using a Swagger document, and you can add it to CI using newman.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.5%
  • Shell 0.5%