Giter VIP home page Giter VIP logo

petstore-postman's Introduction

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:

petstore-postman's People

Contributors

aisabel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.