Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Because every QA should know API Testing

Because every QA should know API Testing

Frederico Moreira

May 07, 2019

More Decks by Frederico Moreira

Other Decks in Technology


  1. Because every QA should know API Testing Frederico Moreira /

    Ramilo Neves
  2. 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
  3. @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
  4. API • Who is here doing an API test today?

    • Who has tested the API? • Who automates API testing?
  5. What is an API? “An API is created when a

    software company intends that other software developers develop products associated with its service.”
  6. Examples • Google ◦ Google Maps ◦ Google Flights •

    Accommodation ◦ Trivago ◦ Airbnb • Payment providers ◦ Paypal ◦ Klarna
  7. Testing data

  8. 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
  9. Anti Patterns

  10. Anti Patterns

  11. 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/).
  12. None
  13. None
  14. 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"
  15. None
  16. None
  17. None
  18. None
  19. None
  20. None
  21. None
  22. None
  23. http:/ /racksburg.com/choosing-an-http-status-code/

  24. Understanding HTTP transactions

  25. request response VIEW

  26. None
  27. Manual Test Tools:

  28. But I really need to automate API tests?

  29. Automated Testing Frameworks:

  30. http:/ /www.mocky.io/

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

  32. API Test Project DB INTERNAL TECH WORKSHOPS Environment

  33. API Test Project DB HTTP

  34. Show me the code...

  35. 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
  36. Questions?