add-test-cases
Add test cases as test runs into a qTest Test Execution suite within a test cycle for streamlined execution management.
Instructions
Test Execution — add test cases as test runs into a qTest Test Execution suite (inside a test cycle)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | ||
| suiteId | Yes | ID of the test execution suite to add runs into | |
| testCases | Yes | Test cases to add as test runs |
Implementation Reference
- Core handler that executes the tool logic: loops over test cases and POSTs each as a test run to qTest, counting successes.
export async function addTestCases(args: AddTestCasesArgs): Promise<AddTestCasesResult> { const { projectId, suiteId, testCases } = args let added = 0 for (const tc of testCases) { try { await qtestFetch( config, projectId, `/test-runs?parentId=${suiteId}&parentType=test-suite`, 'POST', { name: tc.name, test_case: { id: tc.id } } ) added++ } catch { // continue on individual failure — count only successes } } return { added } } - Input type (AddTestCasesArgs) and output type (AddTestCasesResult) definitions.
export interface AddTestCasesArgs { projectId: string suiteId: number testCases: Array<{ id: number; name: string }> } export interface AddTestCasesResult { added: number } - Imports for config and qtestFetch helper used in the handler.
import { config } from '@/config.js'