Skip to content

Fix and complete API tests suite with all TODOs from Maksim Maksimov#235

Open
Maksimovprojects wants to merge 8 commits into
automationExamples:mainfrom
Maksimovprojects:feature/assessment/maksim_maksimov
Open

Fix and complete API tests suite with all TODOs from Maksim Maksimov#235
Maksimovprojects wants to merge 8 commits into
automationExamples:mainfrom
Maksimovprojects:feature/assessment/maksim_maksimov

Conversation

@Maksimovprojects
Copy link
Copy Markdown

@Maksimovprojects Maksimovprojects commented Apr 15, 2026

Overview

Extended the Petstore API project with a complete pytest test suite, GitHub Actions CI pipeline, and bug documentation.

Changes Made

Tests

  • test_pet.py schema validation, findByStatus, 404 edge cases, invalid enum xfail
  • test_store.py PATCH order tests, fixture with teardown, schema validation

API

  • Added DELETE /pets/<pet_id> and DELETE /store/order/<order_id> endpoints

Helpers

  • Extended api_helpers.py with delete_api_data()

CI/CD

  • Added GitHub Actions workflow runs on every push

Documentation

  • Added README.md with setup instructions, test commands, and known bugs table
  • Added requirements.txt

Bugs Found

# Location Description
1 schemas.py line 9 name typed as integer instead of string
2 app.py line 101 Missing f-string in findByStatus abort message
3 app.py POST /pets missing validate=True — accepts invalid enum values
4 app.py POST /pets allows client-supplied IDs
5 app.py No DELETE endpoints — fixed
6 app.py PATCH /order mutates state before validating status
7 app.py findByStatus returns misleading error when status param is missing
test_store test_pet

Pipeline run artefacts (includes Pytest HTML report)
Pipeline test run report
pipeline_run_report

REPORT

- Fixed Bug automationExamples#1: schemas.py - changed pet name type from integer to string
- Fixed Bug automationExamples#2: app.py - added f-string for invalid status error message
- Fixed Bug automationExamples#3: app.py - changed initial pet IDs from 0,1,2 to 1,2,3
- Added Bug automationExamples#4: Marked enum validation test as xfail (known bug)
- Completed test_pet.py: Added parameterized tests for 404 and invalid IDs
- Completed test_store.py: Added PATCH test with fixture and schema validation
- Added Order schema to schemas.py
- Organized tests into classes for better structure
- Added comprehensive edge case testing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant