How bondar-academy/playwright-api-testing-framework works
This repository is a Playwright API-testing framework. Its principal workflow provisions a worker-scoped auth token, creates a fluent request client, sends API requests, and records request/response context for failures; custom matchers add equality and JSON-schema checks. The README also documents environment switching and schema generation. The sampled files show fixture wiring and internal calls, but not how the smoke test consumes the fixtures, so that connection is omitted.
Main entry points: fixtures.ts Playwright fixtures · createToken.ts Auth token creation · request-handler.ts Fluent request handler · logger.ts API logger
Components 11
Configuration and fixtures
- Playwright fixtures
utils/fixtures.ts - Environment config
api-test.config.ts - Auth token creation
helpers/createToken.ts
API requests
- Fluent request handler
utils/request-handler.ts - API logger
utils/logger.ts
Assertions and schemas
- Custom matchers
utils/custom-exptect.ts - Schema validator
utils/schema-validator.ts - Response schemas
response-schemas
Other components
- API test suite
tests/smokeTest.spec.ts - TEST_ENV
- Conduit API
Connections 14
- TEST_ENV → Environment config: selects environment
api-test.config.ts - Playwright fixtures → Environment config: reads config
utils/fixtures.ts - Playwright fixtures → Auth token creation: creates worker token
utils/fixtures.ts - Playwright fixtures → Fluent request handler: provides client
utils/fixtures.ts - Playwright fixtures → API logger: creates logger
utils/fixtures.ts - Playwright fixtures → Custom matchers: sets matcher logger
utils/fixtures.ts - Auth token creation → Environment config: uses credentials
helpers/createToken.ts - Auth token creation → Fluent request handler: sends login request
helpers/createToken.ts - Auth token creation → API logger: creates logger
helpers/createToken.ts - Fluent request handler → Conduit API: sends HTTP requests
utils/request-handler.ts - Fluent request handler → API logger: records activity
utils/request-handler.ts - Custom matchers → Schema validator: validates schema
utils/custom-exptect.ts - Custom matchers → API logger: adds failure context
utils/custom-exptect.ts - Schema validator → Response schemas: reads or generates
utils/schema-validator.ts