debug_testcase
Fetch historical run and failure data for a test case to identify patterns, root causes, and get AI-powered fix suggestions. Use to debug failing tests across branches and runs.
Instructions
Fetch historical execution and failure data for a specific test case. Returns raw historical data with test run details (ID, counter, branch), test runs summary, and a debugging prompt from the API. Each execution includes its associated test run information (testRunId, testRunCounter, branch) to help correlate failures across different test runs and branches. The AI client will analyze the data to identify failure patterns, find root causes, and provide fix suggestions. Use this when you need to debug a failing test case. Example: 'Debug test case "Verify user login"'. Set include_ai_insights=true to also get TestDino's stored AI analysis for this test under ai_fixes: recommendations (investigation/remediation steps + reasoning + historical insight) and quick fixes (concrete fixes, often with code snippets, plus long-term stabilization steps). By default they target the most recent failing execution; pass testrun_id to target a specific run. AI payloads are generated lazily — if ai_fixes sections report status "in_progress", poll get_ai_insights(testrun_id=..., testcase_id=...) until they report "completed". An "unavailable" section carries the upstream statusCode: a 5xx or timeout is transient (retry once via get_ai_insights); a 4xx (bad ids) is terminal.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Project ID (Required). The TestDino project identifier. | |
| testrun_id | No | Only with include_ai_insights: target the AI fixes at this specific run instead of the most recent failure. | |
| testcase_name | Yes | Test case name/title to debug (Required). Example: 'Verify user can logout and login'. | |
| suite_file_path | No | Optional spec file path to disambiguate when several tests share the same title. Example: 'tests/checkout.spec.ts'. | |
| include_ai_insights | No | Attach AI recommendations + quick fixes for this test under `ai_fixes` (targets the most recent failing execution unless testrun_id is set). If a section reports `in_progress`, poll get_ai_insights(testrun_id=..., testcase_id=...) instead of re-calling this tool. |