How ajays0011/playwright-automation---api works
This repository is a Playwright/TypeScript API automation framework for testing the BookStore ToolsQA API. Its main workflow runs account and bookstore test suites through fixtures and service wrappers, sends API requests, then validates responses and contracts. Supporting layers provide environment configuration, token handling, test data, request/response models, custom matchers, and logging. The README documents the test-to-fixture-to-service flow; sampled sources confirm service-to-client calls and client/token-manager HTTP requests. Fixture wiring and several test-to-validation relationships are shown only at the README level.
Main entry points: api-client.ts API client · api-fixtures.ts API fixtures · token-manager.ts Token manager · account.service.ts Account service
Components 20
Test workflows
- Account tests
tests/account - Bookstore tests
tests/bookstore - API fixtures
src/fixtures/api-fixtures.ts
API services
- Account service
src/services/account.service.ts - Bookstore service
src/services/bookstore.service.ts
Request infrastructure
- API client
src/client/api-client.ts - Token manager
src/auth/token-manager.ts - Environment config
src/config/env.config.ts - Test data
src/utils/data-provider.ts - Test helpers
src/utils/test-helpers.ts - Request builder
src/utils/request-builder.ts - Logging
src/utils/logger.ts
Data and validation
- Request models
src/models/request - Response models
src/models/response - Response schemas
src/schemas - Schema validator
src/schemas/schema-validator.ts - Response validator
src/utils/response-validator.ts - Custom matchers
src/matchers/custom-matchers.ts
Other components
- Test runner
- BookStore API
Connections 21
- Test runner → Account tests: runs
README.md - Test runner → Bookstore tests: runs
README.md - Account tests → API fixtures: uses
README.md - Bookstore tests → API fixtures: uses
README.md - API fixtures → Account service: provides services
README.md - API fixtures → Bookstore service: provides services
README.md - Account service → API client: calls
src/services/account.service.ts - Bookstore service → API client: calls
src/services/bookstore.service.ts - API client → BookStore API: sends requests
src/client/api-client.ts - Token manager → BookStore API: requests token
src/auth/token-manager.ts - Token manager → Environment config: reads settings
src/auth/token-manager.ts - Account service → Request models: accepts payloads
src/services/account.service.ts - Bookstore service → Request models: accepts payloads
src/services/bookstore.service.ts - Response validator → Schema validator: validates schemas
src/utils/response-validator.ts - Custom matchers → Schema validator: validates schemas
src/matchers/custom-matchers.ts - Custom matchers → API client: checks responses
src/matchers/custom-matchers.ts - Response schemas → Schema validator: supplies schemas
- Test data → Environment config: selects data
src/utils/data-provider.ts - API client → Logging: logs traffic
src/client/api-client.ts - Response validator → Logging: logs results
src/utils/response-validator.ts - Token manager → Logging: logs activity
src/auth/token-manager.ts