Learn Api Test Automation Using Supertest Framework

Tags: Postman

Node.js, Express, Express-Generator, SuperTest, Jest, Postman

Last updated 2022-01-10 | 4.2

- REST API Testing
- API Test Automation
- Writing API Tests

What you'll learn

REST API Testing
API Test Automation
Writing API Tests
SuperTest Framework
Building Simple APIs for Testing
Postman
Jest
Integration Tests
Software Testing

* Requirements

* Basic understanding of REST APIs
* Basic Understanding of HTTP Requests
* Basic understanding of Nodejs and Express

Description

This course was designed to help you get started with API Test Automation in a simple and effective way. In this course, you will learn how to build simple APIs using Node.js and Express. You will learn how to test those APIs with Postman manually. You will then learn how to create your test project and write and run automated API tests that will help you verify the correct behavior of your API and help you catch bugs and defects as you are making changes to the code later on in the future.


Who this course is for:

  • Software Developers
  • Software Engineers in Tests and SDETs
  • QA Engineers
  • Test Engineers

Course content

6 sections • 21 lectures

Course Outline Preview 05:36

This lecture will go over the course outline and describe what we will cover in this course

Environment Setup Preview 03:29

In this lecture we will cover everything we need to install in order to setup our local environment before starting to write and test our APIs

Installing Express Generator Preview 04:27

In this lecture we will install express generator which is a framework that will help us set up the boiler plate for our project

Installing Nodemon Preview 03:56

here, we will install Nodemon which is a handy tool that will restart our server automatically when it detects changes in our source code

Overview of our APIs Preview 03:57

This is an overview of what APIs we are going to build next

API endpoint for getting all of our users Preview 06:33

In this lecture we will build an api endpoint to return us a list of users

API endpoint for getting a single user by Id Preview 06:11

In this lecture we will build an api that will return us a single user when we provide the id for that specific user

API endpoint to update a user Preview 08:23

We will build an api end point to update a user in this lecture

API endpoint to create a new user Preview 07:07

In this lecture we will create an end point to create a new user

API endpoint to delete a user Preview 05:16

In this lecture we will create an API endpoint to delete a user

Recap of our APIs and source code attachment Preview 01:35

In this lecture we will recap the APIs we built in the previous section. I have also included the source code up to this point which is attached to this lecture.

If you are starting from here, you can download and unzip the folder, Run "npm install" and continue with the rest of the course

Installing SuperTest Framework Preview 06:23

In this lecture we will install the supertest framework so that we can start writing our api tests

Installing Jest Preview 08:50

In this lecture, we are going to install the Jest library which we will use later to run our tests in different modes

Test and Assertions for Getting All Users Preview 13:19

In this lecture we will write an api test to test our end point for getting all of our users. we will also use assertions to verify the expected behavior of our api

Test and Assertions for Getting a User Preview 06:10

In this lecture we will write the test and assertions for getting a single user given an id

Test and Assertions for Creating a New User Preview 08:58

In this lecture we will write the test and assertions for creating a new user

Test and Assertions for Updating a User Preview 08:20

In this lecture we will write the test and assertions for updating a user

Test and Assertions for Deleting a User Preview 04:02

In this lecture we will write the test and assertions for deleting a user

Writing Tests for Error Cases Preview 07:24

In this lecture we will write tests to verify that our APIs handle error cases as expected

Timeouts Preview 04:18

In this lecture we will talk about possible API timeouts and how to account for them in your automated API tests

Recap of the course Preview 02:54

We will go over what we covered in this course. Please note that the finished code is attached to this lecture