Skip to content

Repository files navigation

Playwright API Testing Framework

A production-ready API test automation framework built with Playwright and TypeScript.

Playwright API Testing Mastery Playwright TypeScript


About

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.

👉 Join the program →

What's Inside

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

Getting Started

npm install
npx playwright test           # run the suite
npx playwright show-report    # open the HTML report

Run against a different environment:

TEST_ENV=qa npx playwright test

Licensed under Apache 2.0 · Bondar Academy

About

Bondar Academy. Playwright API Testing Framework Template

Resources

Stars

22 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages