Skip to content

Latest commit

 

History

History
41 lines (32 loc) · 2.49 KB

README.md

File metadata and controls

41 lines (32 loc) · 2.49 KB

Postman + newman + github actions (Simple store template)

Task steps

  1. Read:
  1. Download this repo.
  2. Run npm i (install node.js dependencies)
  3. Run npm run tern-on-api(to run testing server locally )

Overview

Routes /products, /orders and /users. Below is a table of supported operations with products as example resource. The same operations are also supports for orders/ and users/.

VERB Route Input Output
GET /products None Array
GET /products/:id e.g 3 Object
POST /products object Created object
PUT /products object Updated object
DELETE /products/:id e.g 3 Deleted object
  1. Upload store.collection.json in Postman app. (skip this exhibit in case you decide to use another public API )
  2. Make some integration tests in Postman, could be status code/JSON check and so on. ( in case with another API - write tests based on another one).

Examples:

  • Test pagination, by way like http://localhost:3000/users?page=1&pageSize=2.
  • Test sorting, by way like http://localhost:3000/users?sortOrder=ASC&sortKey=firstName. You can sort an any resource response using query parameters sortOrder and sortKey.
  • Test status code for REST API (200,400 and so on).
  • Test response time.
  • Test response thanks to json schema validation.
  • Try to follow AAA approach (arrange, act, assert).
  1. Save new collection with your new integration tests with the same name as store.collection.json. ( in case with another API - another file name for json file)
  2. Push to you github repo in main branch ( in case with local server - save local server as well )
  3. Add Github action to run your tests in Github pages by article or use another GH action.
  4. Check github actions for result.

You can use another API to perform your testing instead of local store API and store.collection.json.