Skip to content

abdullahahmed001/TestForge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TestForge

Modern Python test automation framework for UI and API testing with pytest, Playwright, and requests.

TestForge is a reusable automation framework designed for teams that want a clean Python foundation for UI and API testing. It is structured like a real automation repository rather than a single-script demo. It includes:

  • UI automation foundation with Playwright
  • API automation foundation with requests
  • environment-driven configuration
  • reusable fixtures
  • page-object ready structure
  • logging and reporting hooks
  • API schema validation
  • reusable assertion helpers
  • smoke and regression markers
  • example API and UI tests

Tech Stack

  • Test runner: pytest
  • UI automation: Playwright
  • API automation: requests
  • Config management: pydantic + .env
  • Reporting: pytest-html
  • Parallel execution: pytest-xdist

Project Structure

TestForge/
├── src/framework/
│   ├── api/
│   ├── config/
│   ├── core/
│   ├── pages/
│   └── utils/
├── tests/
│   ├── api/
│   ├── fixtures/
│   └── ui/
├── reports/
├── scripts/
├── .env.example
├── pyproject.toml
├── pytest.ini
└── README.md

Features

  • Centralized runtime configuration
  • API client abstraction
  • API schema validation with Pydantic models
  • Browser/session lifecycle management
  • Base page object support
  • Better reusable assertions for response and payload validation
  • Custom pytest hooks and markers
  • HTML reporting
  • Parallel execution support
  • Easy extension for web, API, and service-layer automation

Setup

cd /Users/abdullahahmed/TestForge
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
playwright install
cp .env.example .env

If you want developer tooling too:

pip install -e ".[dev]"

Run Tests

Run all tests:

pytest

Run only API tests:

pytest -m api

Run only UI tests:

pytest -m ui

Run smoke tests in parallel:

pytest -m smoke -n auto

Reporting

After execution, an HTML report is generated at:

reports/report.html

Configuration

Environment values are loaded from .env.

Example:

BASE_URL=https://www.saucedemo.com
API_BASE_URL=https://jsonplaceholder.typicode.com
BROWSER=chromium
HEADLESS=true
TIMEOUT_SECONDS=15

Included Examples

  • API test for JSONPlaceholder
  • UI smoke test structure using the SauceDemo login page

The sample API test demonstrates:

  • status-code assertion helpers
  • JSON payload key assertions
  • Pydantic schema validation for API responses

Extending The Framework

  • Add more page objects under src/framework/pages/
  • Add domain-specific API clients under src/framework/api/
  • Add shared assertions and helpers under src/framework/utils/
  • Add API response models under src/framework/api/schemas.py
  • Group tests by feature area under tests/api/ and tests/ui/

Next Extensions

  • Allure reporting
  • database validation layer
  • contract testing
  • CI pipeline
  • Dockerized execution
  • visual regression support

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors