create_manual_test_case
Document new test scenarios with detailed steps, preconditions, and metadata. Define priority, severity, and type to organize manual testing.
Instructions
Create a new manual test case. Use this to document new test scenarios, features, or requirements. Supports adding test steps, preconditions, postconditions, and metadata like priority, severity, and type.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Project ID (Required). The TestDino project identifier. | |
| title | Yes | Test case title (Required). A clear, descriptive title for the test case. | |
| suiteName | Yes | Test suite name (Required). The suite where this test case will be created. Use list_manual_test_suites to find suite names. | |
| description | No | Detailed description of what this test case validates. | |
| status | No | Test case status. | |
| testStepsDeclarationType | No | Type of test steps declaration format. | |
| preconditions | No | Prerequisites or setup required before executing this test case. | |
| postconditions | No | Expected state or cleanup actions after executing this test case. | |
| steps | No | Array of test steps. For Classic format: action, expectedResult, and optional data. For Gherkin format: event and stepDescription. Each top-level step can include attachments as URLs or local file paths. | |
| priority | No | Test case priority level. | |
| severity | No | Test case severity level. | |
| type | No | Test case type. | |
| layer | No | Test layer. | |
| behavior | No | Test behavior type. | |
| automationStatus | No | Automation status of the test case. | |
| tags | No | Tags to add to your test cases. | |
| flags | No | Automation flags/checklist options. | |
| attachments | No | Array of attachment URLs or file paths (up to 10MB each). | |
| customFields | No | Custom fields as key-value pairs. Only available if custom fields are configured in test case management settings. |
Implementation Reference
- The handler function that executes the 'create_manual_test_case' tool logic. It validates required args (projectId, title, suiteName), builds the request body with optional fields, processes attachments, calls the API via POST, and returns the response.
export async function handleCreateManualTestCase( args?: CreateManualTestCaseArgs ) { // Read PAT from environment variable (set in mcp.json) or from args const token = getApiKey(args); if (!token) { throw new Error( "Missing TESTDINO_PAT environment variable. " + "Please configure it in your .cursor/mcp.json file under the 'env' section." ); } // Validate required parameters if (!args?.projectId) { throw new Error("projectId is required"); } if (!args?.title) { throw new Error("title is required"); } if (!args?.suiteName) { throw new Error("suiteName is required"); } try { const body: CreateManualTestCaseBody = { projectId: String(args.projectId), title: String(args.title), suiteName: String(args.suiteName), }; // Add optional fields if (args?.description) { body.description = String(args.description); } if (args?.status) { body.status = String(args.status); } if (args?.testStepsDeclarationType) { body.testStepsDeclarationType = String(args.testStepsDeclarationType); } if (args?.preconditions) { body.preconditions = String(args.preconditions); } if (args?.postconditions) { body.postconditions = String(args.postconditions); } if (args?.steps) { body.steps = processStepAttachments(args.steps); } if (args?.priority) { body.priority = String(args.priority); } if (args?.severity) { body.severity = String(args.severity); } if (args?.type) { body.type = String(args.type); } if (args?.layer) { body.layer = String(args.layer); } if (args?.behavior) { body.behavior = String(args.behavior); } if (args?.automationStatus) { body.automationStatus = String(args.automationStatus); } if (args?.tags) { body.tags = String(args.tags); } if (args?.flags) { body.flags = args.flags.map(String); } if (args?.attachments) { // Process attachments: convert local file paths to file data objects (same format as UI) body.attachments = processAttachments(args.attachments); } if (args?.customFields) { body.customFields = args.customFields; } const createManualTestCaseUrl = endpoints.createManualTestCase( String(args.projectId) ); const response = await apiRequestJson<unknown>(createManualTestCaseUrl, { method: "POST", headers: { Authorization: `Bearer ${token}`, }, body, }); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); throw new Error(`Failed to create manual test case: ${errorMessage}`); } } - Input arguments interface (CreateManualTestCaseArgs) defining all parameters accepted by the tool.
interface CreateManualTestCaseArgs { projectId: string; title: string; suiteName: string; description?: string; status?: "Active" | "Draft" | "Deprecated"; testStepsDeclarationType?: "Classic" | "Gherkin"; preconditions?: string; postconditions?: string; steps?: TestStep[]; priority?: "high" | "medium" | "low" | "Not set"; severity?: | "Blocker" | "critical" | "major" | "Normal" | "minor" | "trivial" | "Not set"; type?: | "functional" | "smoke" | "regression" | "security" | "performance" | "e2e" | "Integration" | "API" | "Unit" | "Accessability" | "Compatibility" | "Acceptance" | "Exploratory" | "Usability" | "Other"; layer?: "e2e" | "api" | "unit" | "not set"; behavior?: "positive" | "negative" | "destructive" | "Not set"; automationStatus?: "Manual" | "Automated" | "To be automated"; tags?: string; flags?: ("To be Automated" | "Is flaky" | "Muted")[]; attachments?: string[]; // Array of attachment URLs or file paths (up to 10MB) - will be processed to FileData objects customFields?: Record<string, string>; // Custom fields as key-value pairs } - Request body interface (CreateManualTestCaseBody) used when sending the POST request to the API.
interface CreateManualTestCaseBody { projectId: string; title: string; suiteName: string; description?: string; status?: string; testStepsDeclarationType?: string; preconditions?: string; postconditions?: string; steps?: TestStep[]; priority?: string; severity?: string; type?: string; layer?: string; behavior?: string; automationStatus?: string; tags?: string; flags?: string[]; attachments?: (FileData | string)[]; customFields?: Record<string, string>; } - src/tools/manual-testcases/create-manual-test-case.ts:81-267 (registration)Tool definition object (createManualTestCaseTool) with name 'create_manual_test_case', description, and input schema (JSON Schema) defining all required/optional properties.
export const createManualTestCaseTool = { name: "create_manual_test_case", description: "Create a new manual test case. Use this to document new test scenarios, features, or requirements. Supports adding test steps, preconditions, postconditions, and metadata like priority, severity, and type.", inputSchema: { type: "object", properties: { projectId: { type: "string", description: "Project ID (Required). The TestDino project identifier.", }, title: { type: "string", description: "Test case title (Required). A clear, descriptive title for the test case.", }, suiteName: { type: "string", description: "Test suite name (Required). The suite where this test case will be created. Use list_manual_test_suites to find suite names.", }, description: { type: "string", description: "Detailed description of what this test case validates.", }, status: { type: "string", description: "Test case status.", enum: ["Active", "Draft", "Deprecated"], }, testStepsDeclarationType: { type: "string", description: "Type of test steps declaration format.", enum: ["Classic", "Gherkin"], }, preconditions: { type: "string", description: "Prerequisites or setup required before executing this test case.", }, postconditions: { type: "string", description: "Expected state or cleanup actions after executing this test case.", }, steps: { type: "array", description: "Array of test steps. For Classic format: action, expectedResult, and optional data. For Gherkin format: event and stepDescription. Each top-level step can include attachments as URLs or local file paths.", items: { type: "object", oneOf: [ { properties: { action: { type: "string", description: "The action to perform in this step (Classic format).", }, expectedResult: { type: "string", description: "The expected outcome of this action (Classic format).", }, data: { type: "string", description: "Optional test data for this step (Classic format).", }, attachments: { type: "array", description: "Optional top-level step attachments as URLs or local file paths.", items: { type: "string" }, }, }, required: ["action", "expectedResult"], }, { properties: { event: { type: "string", description: "Gherkin event keyword (Gherkin format).", enum: ["Given", "When", "And", "Then", "But"], }, stepDescription: { type: "string", description: "The step description (Gherkin format).", }, attachments: { type: "array", description: "Optional top-level step attachments as URLs or local file paths.", items: { type: "string" }, }, }, required: ["event", "stepDescription"], }, ], }, }, priority: { type: "string", description: "Test case priority level.", enum: ["high", "medium", "low", "Not set"], }, severity: { type: "string", description: "Test case severity level.", enum: [ "Blocker", "critical", "major", "Normal", "minor", "trivial", "Not set", ], }, type: { type: "string", description: "Test case type.", enum: [ "functional", "smoke", "regression", "security", "performance", "e2e", "Integration", "API", "Unit", "Accessability", "Compatibility", "Acceptance", "Exploratory", "Usability", "Other", ], }, layer: { type: "string", description: "Test layer.", enum: ["e2e", "api", "unit", "not set"], }, behavior: { type: "string", description: "Test behavior type.", enum: ["positive", "negative", "destructive", "Not set"], }, automationStatus: { type: "string", description: "Automation status of the test case.", enum: ["Manual", "Automated", "To be automated"], }, tags: { type: "string", description: "Tags to add to your test cases.", }, flags: { type: "array", description: "Automation flags/checklist options.", items: { type: "string", enum: ["To be Automated", "Is flaky", "Muted"], }, }, attachments: { type: "array", description: "Array of attachment URLs or file paths (up to 10MB each).", items: { type: "string", }, }, customFields: { type: "object", description: "Custom fields as key-value pairs. Only available if custom fields are configured in test case management settings.", additionalProperties: { type: "string", }, }, }, required: ["projectId", "title", "suiteName"], }, }; - src/lib/endpoints.ts:225-228 (helper)Endpoint URL builder that constructs the API URL for creating a manual test case: POST /api/mcp/manual-tests/:projectId/test-cases
createManualTestCase: (projectId: string): string => { const baseUrl = getBaseUrl(); return `${baseUrl}/api/mcp/manual-tests/${projectId}/test-cases`; },