zephyr-api-client
v0.3.3
Published
Zephyr Server API Client: https://support.smartbear.com/zephyr-scale-server/api-docs/v1/
Maintainers
Readme
Zephyr Scale API Client
A TypeScript client for Zephyr Scale Cloud API v2.
Purpose
This project aims to prevent reinventing the wheel by providing a ready-to-use, well-tested API client for Zephyr Scale. No need to write your own client for every project.
Features
- Auto-generated from OpenAPI Specification: Types and client code are generated from the official Zephyr Scale API specification
- Type-safe: Full TypeScript support with comprehensive type definitions
- Well-tested: unit tests for all resources
- Always up-to-date: Automated weekly checks for API changes via GitHub Actions
Installation
npm install zephyr-api-clientUsage
import { ZephyrV2Client } from 'zephyr-api-client';
// Initialize the client
const client = new ZephyrV2Client({
apiToken: 'your-zephyr-api-token'
});
// Get test cases
const testCases = await client.testcases.listTestCases({
projectKey: 'YOUR_PROJECT',
maxResults: 50
});
console.log(testCases.data.values);
// Create a folder
await client.folders.createFolder({
projectKey: 'YOUR_PROJECT',
name: '/folder/subfolder',
folderType: 'TEST_CASE'
});
// Create a test case
await client.testcases.createTestCase({
projectKey: 'YOUR_PROJECT',
name: 'My Test Case'
});API Token
To use this client, you need a Zephyr Scale API token:
- In Jira, click your profile picture
- Select "Zephyr API keys"
- Generate a new API key
For more information, see the Zephyr Scale documentation.
Available Resources
All Zephyr Scale API v2 resources are supported:
client.automations- Test automation executionsclient.testcases- Test case managementclient.testcycles- Test cycle managementclient.testexecutions- Test execution managementclient.testplans- Test plan managementclient.folders- Folder managementclient.projects- Project informationclient.priorities- Priority managementclient.statuses- Status managementclient.environments- Environment managementclient.links- Link managementclient.issuelinks- Issue link queriesclient.healthcheck- API health check
Development
Generate Types from OpenAPI Spec
npm run generateThis downloads the latest OpenAPI specification from Zephyr Scale and regenerates the TypeScript client code.
Run Tests
npm run test
npm run test:ciBuild
npm run buildLint & Format
npm run lint
npm run formatLicense
MIT
