Petstore

Test Pet CRUD

Test cases for GET /pet/{petId} “Find pet by ID” endpoint

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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