Skip to content

Makuaa/Postman_API_Test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Postman-API-Test

This repository contains API tests using Postman with Swagger documentation for the "MyPetStore" API.

Test Cases

Get pet by status "Available"

Get pet by status "Pending"

Get pet by status "Sold"

Get pet without status should return status code 405

Add new pet

  • Method: POST
  • URL: https://petstore.swagger.io/v2/pet/
  • Body:
    {
      "id": 0,
      "category": {
        "id": 0,
        "name": "Catty"
      },
      "name": "Catty",
      "photoUrls": [
        "string"
      ],
      "tags": [
        {
          "id": 0,
          "name": "Catty"
        }
      ],
      "status": "available"
    }
  • Tests:
    • Verify status code is 200
    • Verify "Catty" is included in the response

Get pet by ID

Update existing pet ID & name

  • Method: PUT
  • URL: https://petstore.swagger.io/v2/pet/
  • Body:
    {
      "id": 123,
      "category": {
        "id": 123,
        "name": "Tigress"
      },
      "name": "Tigress",
      "photoUrls": [
        "string"
      ],
      "tags": [
        {
          "id": 123,
          "name": "Tigress"
        }
      ],
      "status": "available"
    }
  • Tests:
    • Verify status code is 200
    • Verify "Tigress" and "123" are included in the response

Update ID

  • Method: PUT
  • URL: https://petstore.swagger.io/v2/pet/
  • Body:
    {
      "id": 8,
      "category": {
        "id": 8,
        "name": "Dx"
      },
      "name": "Dx",
      "photoUrls": [
        "string"
      ],
      "tags": [
        {
          "id": 8,
          "name": "Dx"
        }
      ],
      "status": "available"
    }
  • Tests:
    • Verify status code is 200
    • Verify "8" is included in the response

Delete pet should return status code 404

Collection File

Test Execution

  1. Import the "Mypetstore.postman_collection.json" collection file into Postman.
  2. Run the test cases individually or execute the entire collection.

Feel free to reach out if you have any questions or need further assistance!

About

Postman API Test using Swagger documentation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages