API test - NextensArelB/SwaggerGenerationTool GitHub Wiki

Objective

API tests are checking the interoperability between software systems and components. These tests simulate calls to API endpoints and validate the responses from the server, including happy and unhappy flows.

##Scope

  • Test on a API level
  • Test of Post, Get, Put, Delete actions
  • Test of contract (message structure, regular and fault contracts)
  • Test of each end point
  • Test of happy and unhappy flows (regular and fault responses)
  • Test of different data combinations and specific content
  • Test with authorization keys and tokens

##Assumptions

  • The code in the API is tested via Unit tests
  • API is correctly hosted in Azure with the right configuration

##Who

  • Test Engineer or Developer (depending on the team), review by peer

##When

  • After story completes
  • If applicable following PRA

##Tools

  • Karate

##How

  • See if API rejects the call having no or an incorrect authorization key/token and verify the response
  • Create API tests for each end point where all parameters are invoked with the right parameter value, and incorrect parameter value. This should be done with 1 test case per parameter.
  • Verify of the error reponse is correct (Response status code) and message when the API call is incorrect
  • See if you can measure the performace of an call on production like configured app services
  • In some cases see if you can break the API by sending lot's of messages in a small time frame
  • Some aditional security tests could be performed if this API is critical in terms of security

##Measures

  • Coverage of endpoints
  • Coverage of contracts including http status codes and headers
  • Coverage of autorisation
  • Coverage of authentication

##Issues

  • How to mock dependecies?

Note: there are still tests available in Postman, however these tests will be phased out, no new automated tests will be created in Postman to run in the Pipeline. However Postman can still be used as a tool to perform API tests when in development

⚠️ **GitHub.com Fallback** ⚠️