A production-ready API test automation framework built with Playwright and TypeScript.
This repository is the final result of the Playwright API Testing Mastery program at Bondar Academy.
Every part of this framework is built from scratch during the program — step by step, with a detailed explanation of how each piece works and why it is designed this way. Use it as a reference implementation or as a starting template for your own API test suite.
| Feature | Description |
|---|---|
| Fluent request handler | Chainable API client — api.path().params().body().postRequest(201) |
| Custom expect matchers | shouldEqual, shouldMatchSchema with rich failure output |
| JSON schema validation | AJV-powered response validation with auto-generated schemas |
| API logger | Full request/response context attached to failed tests |
| Auth token fixture | Worker-scoped token created once and reused across tests |
| Multi-environment config | Switch environments with TEST_ENV=qa |
├── helpers/ # Auth token creation
├── response-schemas/ # JSON schemas per endpoint
├── tests/ # Test specs
├── utils/ # Request handler, fixtures, logger, custom expect
└── api-test.config.ts # Environment configuration
npm install
npx playwright test # run the suite
npx playwright show-report # open the HTML reportRun against a different environment:
TEST_ENV=qa npx playwright testLicensed under Apache 2.0 · Bondar Academy