Test Pet CRUD
Test cases for GET /pet/{petId} “Find pet by ID” endpoint
- Check request with valid existing ID
Preconditions: Make sure that Pet with this ID exists, for example send request POST /pet to create it or check db
Steps:
Send request with random valid existing ID (int64)
Expected result:
Status code 200 OK
ID in response is equal to ID from request
Response body has all the fields that Pet object has - Check request with valid non-existent ID
Preconditions: Make sure that Pet with this ID doesn't exist, for example send request DELETE /pet to delete it or check db
Steps:
Send request with random valid non-existent ID (int64)
Expected result:
Status code 404 Not Found
Response body has the message that Pet is not found - Check request with negative input
Steps:
Send request with random negative input
Expected result:
Status code 400 Bad Request
Response body has the message about invalid ID format - Check request with too big input
Steps:
Send request with random number that is bigger than int64 Maximum
Expected result:
Status code 400 Bad Request
Response body has the message about invalid ID format - Check request with string input
Steps:
Send request with random string
Expected result:
Status code 400 Bad Request
Response body has the message about invalid ID format - Check request with special characters in input
Steps:
Send request with random special characters (for example !@#$%^*) in input
Expected result:
Status code 400 Bad Request
Response body has the message about invalid ID format - Check request with empty input
Steps:
Send request with empty input
Expected result:
Status code 400 Bad Request
Response body has the message that required field is not provided - Perfomance test
Steps:
Send many request with different IDs
Expected result:
Status codes according to requests (200, 400, 404)
The server responds without delays or errors