Testing is something that involves many activities, and one of these activities is testing APIs. Many tools and frameworks help increase the API test coverage, and one of the frameworks is Rest-assured.

If you are also curious to know other tools to test APIs, check these links:

Which tools are we going to use here?

The following are the IDE and tools used, but there is no need for changing your tools to follow this tutorial:

Let’s start

I am assuming that you have a designated API ready and running. We will use the API implemented in this tutorial: https://amanajas.medium.com/create-a-rest-api-with-flask-in-less-than-10-minutes-ceb7a434f32e.

Testing APIs with Rest-assured

The first step…


Let’s start

Installing Flask and a little bit more

Assuming that you have python installed in your machine. If not, follow this tutorial before continuing:

Continuing

Create a folder for your project, and inside of the folder, execute the following code.

Creating environment and installing flask lib

Let’s create your primary file type the imports and initial code as demonstrated below.

Create some methods

First, the class Employee is created, extending Resource to act as a front for the rest API. The Employee’ methods become immediately available for calls when the route is defined. Check the complete documentation here: https://flask-restful.readthedocs.io/en/latest/intermediate-usage.html

Class and methods with route defined


There are many tools and frameworks out there for automation, but this time one tool is getting popular when it comes to E2E browser testing, Cypress.


Taken by Thiago Amanajás

The quality responsibility is supposed to get distributed between team members, managers, and others that directly impact a product or project. But to a certain extent, it falls over a few positions, like testers.

It seems familiar nowadays to have in mind that only putting people with determined skills in the right positions will solve any problem. Of course, some still believe that you need to buy the right tool to fix it if something gets broken. But it doesn’t work much when it is about people.

Perspectives from outside

As a tester, we have to overcome many barriers and not only technical…

Thiago Amanajás

Software nerd and data engineer enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store