API Automation With JavaScript

Julia Pottinger's profile
Julia Pottinger

Head of Training and Development at QualityWorks

Challenge Description

Select the things you would include in your automated tests for a specific API and then select one of those tests to write an automated script for using supertest. As an example you could use the following API - https://restful-booker.herokuapp.com/apidoc/index.html

Instructions:

Part 1 - 10 mins

Using the API above and the guide on ‘how to decide which tests you should be automating for your API’ that was shared in the Next Level API Automation talk, create a list of scenarios that:

  1. Would be included in your API automation 

  2. Would not be included in your API automation and why

Part 2 - 15 mins

  1. Clone the repo that was used in the API automation workshop https://github.com/jpott77/api-automation-supertest

Select one of the tests that you would include in your API automation and write the code to automate it

Demo - 5 mins

  • Share what you would include or not include in your API automation and why

  • Share the automated test you wrote for the API

Wrap-up:

API automation as with all other test automation requires some thought and planning to ensure that you reap the intended rewards. API automation is valuable because it can speed up tests, help test at an earlier phase in the SDLC without the need for GUI’s and increase the scope of tests as API-level tests are specifically designed to verify all system components function as intended.

This activity should have allowed you to think about why you automate specific scenarios over others as well as give you practice with writing automation scripts.

What you’ll learn
  • Automate API’s in Javascript using Supertest
  • Decide what API’s to automate
  • Discuss the API Testing Checklist

Prerequisites

Resources

Explore MoT
Managing Distributed QA Teams: Strategies for Success
In an era where remote teams have become the norm, mastering the art of managing hybrid and distributed QA teams is more crucial than ever
MoT Advanced Certificate in Test Automation
Ascend to leadership roles by mastering strategic skills in automation strategy creation, planning and execution
This Week in Testing
Debrief the week in Testing via a community radio show hosted by Simon Tomes and members of the community