Welcome to my QA portfolio project! This repository contains a fully functional Task Manager REST API that I built from scratch using FastAPI, and then rigorously tested through a comprehensive Quality Assurance process.
The goal of this project was not just to build an API, but to demonstrate a complete end-to-end software testing lifecycle. It features a formal test plan, extensive manual testing, automated pytest suites, raw SQL data validation, and a fully integrated CI/CD pipeline.
- Framework: FastAPI
- Database: SQLite
- ORM: SQLAlchemy
- Authentication: JWT (JSON Web Tokens),
passlibwithbcrypt
- Test Framework:
pytest(usingTestClientfor API mocking) - CI/CD: GitHub Actions (Ubuntu runner)
- Test Reporting:
pytest-htmlfor beautiful, self-contained HTML reports - Data Validation: Raw SQL queries via Python
sqlite3
To ensure enterprise-grade stability, this project was subjected to multiple layers of testing:
- Test Planning: Wrote a formal Test Plan detailing the testing strategy and scenarios.
- Manual Testing: Executed 35 distinct manual test cases verifying authentication flows, task CRUD operations, and cross-user isolation.
- Automated Testing: Programmed 31 automated tests using
pytest. Leveraged advanced features like@pytest.mark.parametrizefor negative payload testing and modular database fixtures. - SQL Validation: Validated database integrity, constraints, and relational mapping using 7 raw SQL queries.
- Continuous Integration: Configured a GitHub Actions CI/CD pipeline to automatically run the entire test suite on every push to the
mainbranch.
.
├── .github/workflows/
│ └── tests.yml # GitHub Actions CI/CD Pipeline Configuration
├── app/
│ ├── main.py # Application Entrypoint, FastAPI Instance, & DB Init
│ ├── auth.py # JWT Token Generation & bcrypt Password Hashing logic
│ ├── database.py # SQLAlchemy Engine setup and DB Session management
│ ├── models.py # SQLAlchemy Database Table definitions (User, Task)
│ ├── schemas.py # Pydantic Validation Models for requests/responses
│ └── routers/
│ ├── users.py # API Route controllers for User Signup/Login
│ └── tasks.py # API Route controllers for Task CRUD operations
├── docs/
│ └── test_report.html # Generated HTML report from Pytest execution
├── scripts/
│ ├── populate.py # Python script to insert dummy testing data into the DB
│ ├── screenshot.py # Python script to capture DB validation terminal output
│ ├── smoke_test.py # Python script for automated E2E API smoke testing
│ ├── validate_db.py # Python script that executes raw SQL validation checks
│ └── sql_validation.sql # Raw SQL queries to verify constraints & relations
├── templates/
│ └── qa_dashboard.html # Premium UI HTML template for the QA Test Dashboard
├── tests/
│ ├── conftest.py # Pytest Fixtures, Mocking, and Test DB Initialization
│ ├── test_auth.py # Automated Pytest suite for Authentication Endpoints
│ └── test_tasks.py # Automated Pytest suite for Task Management Endpoints
├── Test_Cases.xlsx # Spreadsheet containing 35 manual test cases & results
└── requirements.txt # Complete list of Python project dependencies
To run this API on your local machine, follow these steps:
-
Clone the repository:
git clone https://github.com/Roza212/task_manager_api.git cd task_manager_api -
Create and activate a virtual environment:
python -m venv venv source venv/Scripts/activate # On Windows source venv/bin/activate # On Mac/Linux
-
Install the dependencies:
pip install -r requirements.txt
-
Run the FastAPI server:
uvicorn app.main:app --reload
-
Explore the API:
- Interactive Swagger UI: http://localhost:8000/docs
- Visual QA Dashboard: http://localhost:8000/qa/dashboard
The automated test suite uses a completely isolated, temporary SQLite database (test_qa_tasks.db) to ensure tests do not pollute your main application data.
To run the test suite and generate a fresh HTML report:
pytest tests/ -v --html=docs/test_report.html --self-contained-html(You can view the generated test_report.html file directly in the browser or via the local QA Dashboard endpoint.)
To verify the integrity of the live database, I wrote a suite of raw SQL queries that bypass the ORM to check for orphaned tasks, duplicate emails, and correct foreign key mapping.
To execute the database validation checks programmatically:
python scripts/validate_db.py(This script will connect to qa_tasks.db, execute the queries in scripts/sql_validation.sql, and print a Pass/Fail summary to the console.)
Building and QA-ing this project from the ground up taught me a tremendous amount about the intersection of software development and quality assurance:
- Test Isolation: I learned the critical importance of using dedicated test databases and Pytest fixtures (
conftest.py) to wipe tables between tests, preventing state leakage and false negatives. - Parametrization: I discovered how much time can be saved by using
@pytest.mark.parametrizeto run a single test function against multiple invalid JSON payloads, keeping the test suite DRY (Don't Repeat Yourself). - CI/CD Debugging: I learned that CI/CD environments (like Ubuntu runners) are highly sensitive to file encoding (like Windows UTF-16 BOMs) and cross-platform pathing, requiring careful configuration of
requirements.txtand GitHub Actions YML files. - Security Testing: Writing negative test cases to intentionally try and access other users' tasks (Data Isolation/Authorization testing) reinforced the importance of verifying
403 Forbiddenresponses, not just200 OKsuccess paths.