Demo basic test automation for APIs with the help of:
- JavaScript
- node.js
- babel
- Jest
- axios
- ajv
- libxmljs
TDD methodology is used to write tests first and then write functions to satisfy them.
GET
requestsPOST
requestsPUT/PATCH
requestsDELETE
request
- Clone this repository
cd
into the cloned folder- Run
npm install
- Open Go REST and generate access token following instructions on the site.
- Update TOKEN constant in
./src/utils/constants.js
with the token generated in step 4. - Execute tests with
npm run test
- Delete
package-lock.json
andnode_modules
folder - Run
npm install
again.
- Some tests (3 at the time of writing this doc) will fail due to actual bugs found by this automation framework.
- Some tests may randomly fail because the API is open for anybody to make changes at any time.
Enjoy! :)