Skip to content

juliofarah/codeceptjs-rest-demo

 
 

Repository files navigation

Codacy Badge Build Status Greenkeeper badge"Buy Me A Coffee"

Introduction

This project demonstrates how to use CodeceptJS with REST helper.

How to use

This is done using CodeceptJS https://codecept.io/

Tech

This test uses a number of open source projects to work properly:

*https://nodejs.org/en/ - evented I/O for the backend *https://codecept.io/ - CodeceptJS *https://reqres.in/ - Endpoints that are used in this porject

Installation

This requires Node.js v8+ to run.

Install the dependencies and devDependencies.

cd codeceptjs-rest-demo
npm i

How to trigger API tests

To run all api tests just simply type

npm test

Example output

CodeceptJS v3.0.4
Using test root "/Users/tamara-thanh/Desktop/codeceptjs-rest-demo"

DELETE tests --
  ✔ Verify deleting a user in 168ms
GET tests --
  ✔ Verify a successful call in 122ms
  ✔ Verify a not found call in 146ms
  ✔ Verify getting a single user in 102ms
  ✔ Verify getting list of users in 108ms
POST tests --
  ✔ Verify creating new user in 152ms
  ✔ Verify uploading a file in 891ms
PUT tests --
  ✔ Verify creating new user in 143ms

  OK  | 8 passed   // 2s

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 66.2%
  • JavaScript 21.1%
  • Shell 6.6%
  • Dockerfile 6.1%