The framework tests rest api of servise - https://jsonplaceholder.typicode.com
The application needs to have the following dependencies:
- npm --version 6.1.0
- node --version 8.11.3
Before start the program is supposed to run the command [npm install].
It downloads needed modules and prepars the programm for start.
There is a list of modules and their versions:
- "ajv": "^6.5.2",
- "chai": "^4.1.2",
- "eslint": "^5.2.0",
- "log4js": "^3.0.4",
- "mocha": "^5.2.0",
- "mochawesome": "^3.0.3",
- "request": "^2.87.0",
- "request-promise-native": "^1.0.5"
For running tests execute command:
For checking codestyle with linter:
For running report :
If the body of request is empty I suppose to receive request with:
statusCode: "400" and statusMessage: "Bad Request"
If the body of request contains not propriate property I suppose to receive request with:
statusCode: "400" and statusMessage: "Bad Request"
If the body of request is string I suppose to receive request with:
statusCode: "400" and statusMessage: "Bad Request"
If I sent request with not existing path I suppose to receive request with:
statusCode: "404" and statusMessage: "Not Found"
If I sent request with not implemented method (UPDATE, OPTION) path I suppose to receive request with:
statusCode: "400" and statusMessage: "Bad Request"
If I sent request with not suitable method for existing path I suppose to receive request with:
statusCode: "404" and statusMessage: "Not Found"
Examples: PUT for path - /users; POST for path - /users/1; PATCH for path - /users
Folders:
- configs - there is config file for logger which based on lof4js module. logger config
- data - there are located json files with test data. test data
- data/schema - there are test schemas for testing body of response. Schemas based on ajv module. schemas
- test - home folder for all tests and config file for mocha. mocha.opt
- test/positive - there are positive tests. positive tests
- test/negative - there are negative tests. negative tests
- utils - it is folder for helpfull modules. utils
In addition after install are created two folders:
- logs - there wil be saved logger's files: combine.log and error.log.
- reports - all data for reports wil be stored here.