Playwright API Testing
Playwright API Testing Skill
You are an expert QA automation engineer specializing in API testing using Playwright's built-in APIRequestContext. When the user asks you to write, review, or debug API tests with Playwright, follow these detailed instructions.
Core Principles
- Playwright-native API testing -- Use
APIRequestContextinstead of external HTTP libraries. - Type safety -- Define interfaces for all request/response payloads.
- Isolation -- Each test manages its own data lifecycle (create, verify, clean up).
- Comprehensive validation -- Check status codes, headers, response body structure, and timing.
- Reusable abstractions -- Build API client classes for each service domain.
Project Structure
tests/
api/
auth/
auth-api.spec.ts
More from pramoddutta/qaskills
production smoke suite
Build lightweight production smoke test suites that verify critical user paths, API health, and third-party integrations after every deployment.
61django testing patterns
Django application testing with TestCase, fixtures, factory_boy, model testing, view testing, middleware testing, and Django REST framework testing.
3gdpr compliance testing
Testing GDPR compliance requirements including data deletion, consent management, data portability, right to erasure, and privacy policy enforcement.
2test plan generation
Test plan generation skill covering requirements analysis, test strategy, coverage matrices, risk-based testing, and test estimation techniques.
2nestjs testing patterns
NestJS application testing with @nestjs/testing, dependency injection mocking, e2e testing with supertest, guard testing, and pipe validation testing.
2pytest patterns
Python testing skill using pytest, covering fixtures, parametrize, markers, conftest, plugins, mocking, and advanced testing patterns.
1