Coding and testing an authentication API [NodeJs + Cypress]

How to create the API endpoints

How to install and use Cypress

How to create a Mongo database for your API

How to encrypt passwords

How to create negative and positive tests for API flows in Cypress

How to make the tests robust and remove code duplication

Requirements

  • A Windows or Mac computer
  • IntelliJ installed
  • Postman installed

Description

Have you ever wondered how a login API actually works? Have you ever wanted to learn how to test the login API?

We created this free tutorial to fill this knowledge gap.


I’ll walk you through how to:

  • How to create the API endpoints
  • How to install and use Cypress
  • How to create a Mongo database for your API
  • How to encrypt passwords
  • How to create negative and positive tests for API flows in Cypress
  • How to make the tests robust and remove code duplication

This is a tutorial for test automation professionals who already have an understanding of:

  • How APIs work
  • You have basic JavaScript knowledge
  • You want to keep improving in your domain

Prerequisites for the course:

A Windows or Mac computer

IntelliJ installed

Postman installed

So what are you waiting for? Let’s jump into the tutorial.

Don’t just take my word for it, check out what existing students have to say about my other courses:

“The C# section is taught by someone else, which surprised me, but I think they did a great job at instructing at a beginner level. The Selenium materials are quite comprehensive and the instructor is easy to follow and understand.

“Well I can’t explain in words how much am excited after completing this course. The more I was close to completion the more am getting excited. You are a great instructor Nikolay. You don’t just taught Selenium but other aspects of being a beautiful coder. Now am pretty confident and can say “Yes” to my clients when they need me to automate the application. Thank you Sir for all the hard work and effort you put in the course. Surely would like to see you in another engaging course!” – Randhawa Verma

Wonderful content and things explained in a nutshell. Overwhelmed by Author’s dedication to put things in such a way that any novice or manual tester can follow and understand and definitely be on-boarded as a Selenium Automation Engineer next day at work. Thanks a million times for creating these courses! One Stop for Automation.” – Rupashree Geethaaviji Ananthakrishna

“I am familiar with Nikolay from a course I saw on TestAutomation and have the highest regard for him. Glad to see him on Udemy.” – Annamalai Viswanathan

“One Of the Best courses on Selenium With C#. Cheers Nikolay!!” – Saransh Vaid

Who this course is for:

  • A test automation professional who wants to deepen your knowledge with API testing
  • Understand how APIs work
  • Have basic JavaScript knowledge
  • Want to keep improving in your domain

Course content

1 section • 20 lectures • 1h 56m total length

Introduction20 lectures • 1hr 56min

  • Introduction00:48
  • Start a Server03:09
  • Register endpoint04:23
  • Testing endpoint with Postman and Cypress09:03
  • Updating Cypress to be robust02:47
  • Creating Mongo DB03:58
  • Hiding username and password in env file03:13
  • Registering out first user11:16
  • Add positive and negative test case07:31
  • Making a more robust test03:42
  • Removing duplication04:12
  • Add body validation logic08:54
  • Add creation validation test12:56
  • Extract validation06:42
  • Logic to avoid duplicate user creation10:17
  • Encrypt a password05:26
  • Add login endpoint05:45
  • Testing the login endpoint05:02
  • Add JWT06:33
  • BONUS LECTURE!!!00:48