Skip to content

abalestra22/perfdog_api_tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PerfDog API Tests

This repository contains automated tests for the PerfDog pet store API, based on the public Swagger Petstore API.

The goal is to validate backend functionality before the frontend is available.


Technical Requirements


Project Structure

perfdog_api_tests/
├── requirements.txt              # Python dependencies
├── .gitignore                    # Excludes venv, cache, etc.

├── tests/                        # All test cases
│   ├── conftest.py               # Shared fixtures
│   ├── pets/                     # Pet-related test cases
│   │   └── test_pets.py
│   ├── orders/                   # Order-related test cases
│   │   └── test_orders.py

├── utils/                        # Shared logic and helpers
│   ├── api_clients/              # CRUD interfaces
│   │   ├── api_client_pet.py
│   │   └── api_client_order.py
│   ├── endpoints/                # Only builds endpoint URLs
│   │   ├── pets_endpoints.py
│   │   └── orders_endpoints.py
│   ├── assertions.py             # Custom assertion helpers
│   ├── decorators.py             # @mandatory and @optional markers
│   └── logger.py                 # Logger config with coloredlogs

Installation

  1. Clone this repo:

    git clone https://github.com/abalestra22/perfdog_api_tests.git
    cd perfdog_api_tests
    
  2. Create and activate a virtual environment (optional but recommended):

    python -m venv .venv
    source .venv/bin/activate  # or .venv\Scripts\activate on Windows
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Run all tests with:

    pytest -v
    
  • To run only mandatory tests (required for main deliverable):

    pytest -v -m mandatory
  • To run only optional (extra/bonus) tests:

    pytest -v -m optional

⚠ Known Limitations (Swagger Demo API)

This project uses the public Swagger Petstore API, which is intended for demo purposes. It has a few known limitations:

  • DELETE /pet/{id} returns success (200) but does not actually delete the pet. Subsequent GET requests still retrieve the "deleted" pet.
  • POST /store/order accepts a petId, but GET /store/order/{id} always returns petId: 0, ignoring the value submitted.

How We Handle This

Affected tests are marked with @pytest.mark.xfail. This means:

  • They still run to document expected behavior.
  • Their failure is ignored by the test suite and will not break CI or pytest -v.

This helps keep visibility while acknowledging external API constraints.

Author

Andrea Balestra GitHub: abalestra22

About

Automated test suite for API tests powered by Pytest.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages