get_failure_details
Retrieve full root-cause-analysis including traces and screenshots for every failed test in the most recent run. Use when a test fails to understand why and gather artifacts for debugging.
Instructions
Extract full root-cause-analysis materials for every failed test in the most recent run.
Behavior:
Reads report.json, filters tests where outcome == 「failed」
pytest: parses Playwright trace.zip → extracts real API call sequence (Frame., Page., Locator., ElementHandle. events) as steps[]
Maestro: parses flow YAML for
takeScreenshot:directives → resolves .png at PROJECT_ROOT rootBest-effort resolves screenshot / trace.zip / video / recording paths from --output / --debug-output artifact directories Returns: list[{nodeid, title, message, duration, steps[], screenshot, trace, video}]
When to use:
run_tests just reported failed > 0 → drill into each case
User asks 「why did it fail / show me the trace / what broke」
Filing a JIRA bug → use the artifact paths to attach screenshot+trace
Comparing failure signatures across runs (pair with get_test_history)
When NOT to use:
Want the summary count only → use get_test_report (lighter)
No tests have been run yet → returns [{error: 「找不到報告」}]
Want details for PASSING tests too → not supported here; the HTML reporter renders those via a different path
Edge cases:
test_id substring matches nothing → empty list, no error
screenshot/trace/video missing on disk → those fields are null but the entry stays
Retry-recovered flake (was failed, now passed) → not listed here; surfaces in summary.flaky_in_run instead
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| test_id | No | 選填,僅回傳 nodeid 含此關鍵字的 case(substring match,不分大小寫)。省略則回傳全部失敗 case。常用模式:先全部抓→看到特定模式後再用 test_id 收斂。 |