A scalable API automation framework built using Playwright Test, designed to support reliable testing, faster feedback cycles, and maintainable architecture for Agile teams.
This repository serves as a polished example suitable for interviews or portfolio demonstrations. It includes:
- Clear folder organization (
tests,utils,config,data) - Reusable utilities and environment configuration
- CI/CD workflow using GitHub Actions
- Sample API tests exercising GET/POST/PUT/PATCH/DELETE requests
- Lightweight and easy to extend to new services
The goal of this framework is to provide a clean and extensible structure for API automation by:
- Validating critical API workflows
- Improving regression efficiency
- Supporting maintainable and scalable test design
- Enabling future CI/CD integration
The framework follows a modular design to keep test logic reusable and easy to scale.
Key design principles:
- Separation of test logic and API utilities
- Reusable request handling
- Environment-based configuration
- Clean test data management
tests/ → Contains API test cases utils/ → Helper methods for API requests and validations config/ → Environment configurations and base setup data/ → Test data and payloads
This structure helps teams extend tests without breaking existing workflows.
The framework supports flexible configuration to allow testing across different environments such as:
- books
- activities
- staging
Configuration values can be managed centrally to avoid hardcoding test data.
- Node.js 18+ (LTS recommended)
- npm or yarn
- Git (to clone the repo)
npm ci # install dependencies
npx playwright install # download browsers (not needed for API tests but kept for completeness)By default the framework targets the books environment (configured in config/config.js). You can switch environments by setting the TEST_ENV variable:
# run against default (`books`) service
npm test
# run against activities environment
TEST_ENV=activities npm testThe test script is defined in package.json and simply calls npx playwright test. You can show the HTML report after execution with:
npm run report- Modular architecture – configuration, utilities and data are separated from test logic.
- Environment support – easily switch between
books,activitiesorstagingby changing a variable. - Reusable helpers – located under
utils/, e.g. authentication helper. - Clean test data – payloads stored in
data/JSON files for clarity and reuse. - CI/CD ready – GitHub Actions workflow is included; badge at top of this README.
- License & contribution guide – MIT license and
CONTRIBUTING.mddemonstrate open source best practices.
This framework is designed to integrate easily with CI/CD pipelines such as GitHub Actions or Jenkins to support automated quality gates.
- Focus on API-level automation to reduce heavy UI dependency
- Modular utilities for better maintainability
- Scalable structure aligned with Agile team workflows
- Add data-driven testing and parametrization
- Implement contract testing (e.g. with Pact)
- Add linting and pre-commit hooks
- Extend utilities with common request/response validation helpers
- Integrate with Slack or email for failures in CI
Test → API Client → Config → Environment → Validation → Report
⭐ This repository represents a practical example of building scalable API automation aligned with modern QA engineering practices.