ScanAPI

Automated Integration Testing and Live Documentation for your API

Camila Maia

APIs Open-Source RESTful Test Libraries (pytest/nose/...) Testing

See in schedule Download/View Slides

In the current IT scenario, the use of APIs is, without question, widely vast, popular, and significant. It seems at least prudent to ensure they are working properly, as expected. To guarantee the quality of the data that is being consumed or used. To ensure that communication between services is occurring as expected. To ensure the system does, in fact, what it should do.

ScanAPI is an open-source library that was created to solve all these points. ScanAPI provides an easy way to create integration tests for REST APIs via configuration files.

The three main reasons that led me to the creation of this library were:

1. To be a firefighter in a scenario where most of the reported bugs were directly related to some API contract being broken or some endpoint having a behavior different from that expected by the consumer.

2. To need to deal with APIs with outdated or mistaken documentation.

3. To need to debug an endpoint in the middle of a "chain" of other endpoints. Where I needed to recreate a state that depends on the action of other endpoints.

Given a fictitious example: debug an endpoint to reserve seats on an airplane, which depends directly on the previous call of an endpoint for user registration.

The ScanAPI is open-source and written in Python. However, it can be used in APIs created in any other programming language, since the tests provided by it are integration tests.

With ScanAPI you can:

- Use environment variables
- Create variables
- Chaining requests - making a request from a result of previous responses
- Hide sensitive information of the requests and responses in the generated report
- Write Python code - if you want, it's not necessary :)

Topics I intend to address in this talk:

- Motivation to create the library
- What problems the library solves
- How to test an API using a ScanAPI
- Show the documentation generated by ScanAPI
- An overview of how it is implemented
- Where it is currently being used
- Next steps

Project Link: https://github.com/scanapi/scanapi

Prerequisites:
- Python
- REST APIs
- Integration tests

Type: Talk (30 mins); Python level: Intermediate; Domain level: Intermediate


Camila Maia

Loadsmart

I've been coding professionally since 2012, mostly with the Ruby and Python programming languages in the web development. Presently, I am developing mainly with Python. I've passed through different business fields during my career, like computing security, e-commerce, e-learning and finally and currently: logistics and supply chain.

Backend development is my favorite one and my focus, I love to learn a bit from each area which I have direct contact to though. You can find me playing around with mobile development, data science or frontend during my free time. I believe in the value of t-shaped professionals.