Skip to content

This collection contains a set of request for petstore.swagger.io using Postman and integrated with Travis CI

Notifications You must be signed in to change notification settings

aisabel/PetStore-Postman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Business Requirement:

Create automated tests to cover at least the CRUD (create, read, update, delete) operations on a pet store website

TestFramework Description:

This test suite was designed to meet business requirements by createing automated test based on a swagger api: petstore.swagger.io
Postman is an API client that makes it easy for developers to create, share, test and document APIs. This is done by allowing users to create and save simple and complex HTTP/s requests, as well as read their responses.
This test suite is configured to be continuosly integrated in Travis for a fast pace development environment.

Specifications:

TestingFramework Structure:

In order to provide a clear functional framework, the structure has been settup as below:

    |--results
    |--tests:
    • PetStoreEnv.postman_collection.json = environment defined to run collection
    • SwaggerPetStore.postman_collection.json = postman collection

Install

Postman application is open source software, a Javascript application designed to load test functional behavior. Postman's features simplify each step of building an API and streamline collaboration so you can create better APIs—faster. The tool can be downloaded at: https://www.postman.com/downloads/
Postman test can be run from command line using node.js https://nodejs.org/es/

Run Tests:

How to run tests locally using Postman

  • Install Postman
  • Double click to open postman
  • In the top menu go to File > Import
  • Locate in your local machine the file with the postman_collection extension
  • Click on the gear in the right top "manage environments" and choose from your local machine the file with the environent extension
  • Click on "Import" button
  • There are two ways to send request: The first one is click on each request and then click button "send". The other one is to click button in the top menu "Runner"
  • The first one is click on each request and then click button "send".
  • The other one is to click button in the top menu "Runner", select the collection to run and the environment to be used and click button "Start Run". Within this option the number of iterations can be set up manually so the runner will be exceuted "n" times. This option also allows to add delays between each request.

How to run tests from the command line

  • To run the testplan from the command line you need to open a command prompt of Node.js
  • Traverse locally until folder where postman test are located
  • Run the command: newman run with the following parameters:
  • Parameters:
      - Path to the collection name
      - folder name to run (if applies)
      - environment to use
      - the last part is the one where you will store the report formatter (the formatter is located in this repo for your convenience) finally the last part has the name of the html file where you will find the results of the test.
  • Example: newman run C:\git\Projects\PetStore.postman_collection.json -e C:\git\Projects\environments\PetStore.postman_environment.json --delay-request 2000 --reporters cli,html --reporter-html-export PostmanResult.html
  • Note: the postman files must have the extension .json in order to be used with newman, otherwise will not be recognized

External references:

About

This collection contains a set of request for petstore.swagger.io using Postman and integrated with Travis CI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages