get_all_tcm_test_cases_by_project
Retrieve all test cases for a specific project from Zebrunner Test Case Management with configurable output formats and pagination controls.
Instructions
๐ Get ALL TCM test cases by project using comprehensive pagination
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_key | Yes | Project key (e.g., 'android' or 'ANDROID') | |
| format | No | Output format | json |
| include_clickable_links | No | Include clickable links to Zebrunner web UI | |
| max_results | No | Maximum number of results (configurable limit for performance) |
Implementation Reference
- src/api/enhanced-client.ts:672-722 (handler)Main handler implementation for retrieving all TCM test cases by project using paginated API calls to /test-cases endpoint with token-based pagination. Collects all pages until no nextPageToken.async getAllTCMTestCasesByProject(projectKey: string): Promise<ZebrunnerShortTestCase[]> { const allItems: ZebrunnerShortTestCase[] = []; let nextPageToken: string | undefined = undefined; let hasMore = true; let pageCount = 0; while (hasMore && pageCount < 1000) { // Safety limit // Direct API call to avoid circular dependency with getTestCases const params: any = { projectKey, maxPageSize: 100 // Use maximum allowed page size }; if (nextPageToken) { params.pageToken = nextPageToken; } const response = await this.retryRequest(async () => { const apiResponse = await this.http.get('/test-cases', { params }); const data = apiResponse.data; if (Array.isArray(data)) { return { items: data.map(item => ZebrunnerShortTestCaseSchema.parse(item)) }; } else if (data.items) { return { items: data.items.map((item: any) => ZebrunnerShortTestCaseSchema.parse(item)), _meta: data._meta }; } return { items: [] }; }); allItems.push(...response.items); // Check for next page token in metadata nextPageToken = response._meta?.nextPageToken; hasMore = !!nextPageToken; // Stop only when nextPageToken is null pageCount++; if (this.config.debug) { console.error(`๐ [TestCases] Fetched page ${pageCount}: ${response.items.length} test cases (total: ${allItems.length})`); } } if (pageCount >= 1000) { console.error('โ ๏ธ [TestCases] Stopped pagination after 1000 pages to prevent infinite loop'); } return allItems; }