A multi-protocol testing DSL designed for Developer + AI collaboration
TSpec (Test Specification) is a YAML-based domain-specific language for defining API test cases. Designed for both AI-assisted test generation and developer maintainability.
Designed from the ground up for AI-assisted test generation with structured metadata and clear context
Rich assertion types including JSON path, regex, JavaScript, and response time validation
Reuse test configurations across multiple test cases
Parameterized testing with multiple data sources (CSV, JSON, YAML)
Built-in functions and dynamic variable substitution
Setup and teardown for test isolation and state management
npm install @boolesai/tspec
npm install -g @boolesai/tspec-cli
A complete test specification in a single, readable YAML file.
version: "1.0" description: "Verify successful login" metadata: prompt: | Test that a user with valid credentials can successfully login and receive a JWT token. tags: ["auth", "login", "smoke"] http: method: "POST" path: "/v1/auth/login" headers: Content-Type: "application/json" body: json: username: "${username}" password: "${env.PASSWORD}" assertions: - type: "json_path" expression: "$.status" expected: 200 - type: "json_path" expression: "$.data.token" operator: "exists"