Slide 1

Slide 1 text

Because every QA should know API Testing Frederico Moreira / Ramilo Neves

Slide 2

Slide 2 text

Brazil (Minas Gerais) ● Café, testes e pão de queijo ● MTC - Minas Testing Conference Agile Testers ● Fórum ● Agile Testers Conference UAI, TREM, SÔ, PÃO DE QUEIJO ● if(cachaça || bagaço) @fredaomoreira @farfetch

Slide 3

Slide 3 text

@ramilomcneves @farfetch Brazil (Petrópolis - Rio de Janeiro) ● Tester Automation Engineer ● In love with football –Flamengo (Brazil) –Porto (Portugal) ● Living two years in Porto ● Second time speaking at PTM

Slide 4

Slide 4 text

API ● Who is here doing an API test today? ● Who has tested the API? ● Who automates API testing?

Slide 5

Slide 5 text

What is an API? “An API is created when a software company intends that other software developers develop products associated with its service.”

Slide 6

Slide 6 text

Examples ● Google ○ Google Maps ○ Google Flights ● Accommodation ○ Trivago ○ Airbnb ● Payment providers ○ Paypal ○ Klarna

Slide 7

Slide 7 text

Testing data

Slide 8

Slide 8 text

Service Level Tests Subcutaneous Test - Martin Fowler Fills gap between unit and UI tests They occur in parallel to the development Focus on functionality rather than behavior / experience

Slide 9

Slide 9 text

Anti Patterns

Slide 10

Slide 10 text

Anti Patterns

Slide 11

Slide 11 text

The most common to find in the market are new designs using Rest, over HTTP protocol. But you can use Rest with other protocols like TCP, UDP and gRPC (http:/ /www.grpc.io/).

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

What we validate in a api test? ➔ http status code 200, 201, 400, 401, 500 ... ➔ body content Json, Plain text, XML ... ➔ http headers "Content-Type"":"application/json"

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

http:/ /racksburg.com/choosing-an-http-status-code/

Slide 24

Slide 24 text

Understanding HTTP transactions

Slide 25

Slide 25 text

request response VIEW

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

Manual Test Tools:

Slide 28

Slide 28 text

But I really need to automate API tests?

Slide 29

Slide 29 text

Automated Testing Frameworks:

Slide 30

Slide 30 text

http:/ /www.mocky.io/

Slide 31

Slide 31 text

https:/ /github.com/fredmoreira/register-employees

Slide 32

Slide 32 text

API Test Project DB INTERNAL TECH WORKSHOPS Environment

Slide 33

Slide 33 text

API Test Project DB HTTP

Slide 34

Slide 34 text

Show me the code...

Slide 35

Slide 35 text

Repositórios: https:/ /github.com/fredmoreira/register-employees-pyresttest https:/ /github.com/fredmoreira/register-employee-rest-assured-test https:/ /github.com/fredmoreira/register-employees-super-test https:/ /github.com/RamiloNeves18/register-employees-httparty https:/ /github.com/fredmoreira/phone-book https:/ /github.com/RamiloNeves18/register-employees-restsharp https:/ /github.com/fredmoreira/register-employees

Slide 36

Slide 36 text

Questions?