get_test_execution_history
Retrieve execution history for a test across multiple launches, showing pass/fail history, last passed execution, and pass rate to analyze test reliability.
Instructions
📊 Get execution history for a test across multiple launches - shows pass/fail history, last passed execution, and pass rate
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| testId | Yes | Test ID | |
| testRunId | Yes | Test Run ID / Launch ID containing the test | |
| projectKey | No | Project key (e.g., 'MCP') - alternative to projectId | |
| projectId | No | Project ID - alternative to projectKey | |
| limit | No | Number of history items to return (default: 10, max: 50) | |
| format | No | Output format: dto (structured), json, or string (markdown table) | string |
Implementation Reference
- src/api/reporting-client.ts:401-419 (helper)The core API client method that implements fetching test execution history across launches for a specific test using the Zebrunner Reporting API endpoint.async getTestExecutionHistory( launchId: number, testId: number, projectId: number, limit: number = 10 ): Promise<TestExecutionHistoryResponse> { const url = `/api/reporting/v1/launches/${launchId}/tests/${testId}/history?projectId=${projectId}&limit=${limit}`; if (this.config.debug) { console.log(`[ZebrunnerReportingClient] Fetching test execution history for test ${testId} (limit: ${limit})`); } const response = await this.makeAuthenticatedRequest<any>('GET', url); // Handle different response structures const historyData = response.data || response; return TestExecutionHistoryResponseSchema.parse(historyData); }
- src/types/reporting.ts:320-324 (schema)Zod schema defining the response structure for test execution history, including array of history items with status, duration, timestamps, etc.export const TestExecutionHistoryResponseSchema = z.object({ items: z.array(TestExecutionHistoryItemSchema) }); export type TestExecutionHistoryResponse = z.infer<typeof TestExecutionHistoryResponseSchema>;
- src/types/reporting.ts:303-317 (schema)Zod schema for individual test execution history item containing status, elapsed time, issue references, timestamps.export const TestExecutionHistoryItemSchema = z.object({ testId: z.coerce.number(), status: z.string(), passedManually: z.boolean(), elapsed: z.coerce.number(), // Duration in milliseconds issueReferences: z.array(z.object({ id: z.coerce.number().optional(), type: z.string(), value: z.string() })), testRunId: z.coerce.number(), startTime: z.coerce.number() // timestamp }); export type TestExecutionHistoryItem = z.infer<typeof TestExecutionHistoryItemSchema>;