test-api

Execute REST API tests with Playwright HTTP client and Zod schema validation.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/lgtm-hq/claude-skills --skill test-api-lgtm-hq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-api
Source: https://github.com/lgtm-hq/claude-skills/tree/main/skills/test-api
Command: npx skills add https://github.com/lgtm-hq/claude-skills --skill test-api-lgtm-hq

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies the process of writing, validating, and maintaining API tests by leveraging Playwright's HTTP client and Zod schemas.

Core Features & Use Cases

  • Schema Validation: Enforces strict property checks on API responses to ensure API contracts are honored. For example, catching unexpected API changes that could break integrations.
  • Type Safety and Derivation: Derives TypeScript types directly from Zod schemas, preventing discrepancies between validation and data types.
  • Reusable Testing Patterns: Provides standardized structures for error checking, parameterized tests, and security validation, making test suites more consistent and reliable.

Quick Start

Use the test-api to write a test that verifies API response conforms to the defined schema and handles errors correctly.

Frequently Asked Questions about test-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate REST API responses against a schema in Playwright?

You validate REST API responses by defining Zod schemas and applying them to Playwright HTTP client responses, enforcing strict property checks to ensure API contracts are honored and preventing unexpected integration breaks.

Can I derive TypeScript types directly from my API validation schemas?

Yes, you can derive TypeScript types directly from Zod schemas. This prevents discrepancies between your runtime validation logic and your static data types, ensuring API test type safety and consistency.

What is the best way to structure reusable API testing patterns for error checking?

The best way to structure API testing patterns is using standardized structures for error checking, parameterized tests, and security validation, making your REST API test suites consistent and reliable across different endpoints.

Does Playwright's HTTP client work well for comprehensive REST API test coverage?

Yes, Playwright's HTTP client works well for comprehensive REST API test coverage. It executes requests and integrates with schema validation to promote contract compliance and type safety across your API endpoints.

Why does schema validation help catch unexpected API changes during testing?

Schema validation helps catch unexpected API changes by enforcing strict property checks on response payloads. If an API alters its structure, the Zod schema validation fails immediately, highlighting contract breaks before deployment.