← ClaudeAtlas

playwright-api-testinglisted

API testing skill using Playwright's built-in APIRequestContext for RESTful service validation, authentication flows, and API contract verification.
KaliBellion/qaskills · ★ 3 · Testing & QA · score 72
Install: claude install-skill KaliBellion/qaskills
# 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 1. **Playwright-native API testing** -- Use `APIRequestContext` instead of external HTTP libraries. 2. **Type safety** -- Define interfaces for all request/response payloads. 3. **Isolation** -- Each test manages its own data lifecycle (create, verify, clean up). 4. **Comprehensive validation** -- Check status codes, headers, response body structure, and timing. 5. **Reusable abstractions** -- Build API client classes for each service domain. ## Project Structure ``` tests/ api/ auth/ auth-api.spec.ts users/ users-api.spec.ts users-crud.spec.ts products/ products-api.spec.ts fixtures/ api.fixture.ts auth-api.fixture.ts models/ user.model.ts product.model.ts api-response.model.ts clients/ base-api-client.ts users-api-client.ts products-api-client.ts utils/ api-helpers.ts schema-validator.ts playwright.config.ts ``` ## Configuration ```typescript import { defineConfig } from '@playwright/test'; export default defineConfig({ testDir: './tests/api', fullyParallel: true, retries: process.env.CI ? 1 : 0, reporter: [ ['html'], ['json', { outputFile: 'test-results/api-results.json' }], ], use: {