Momentic automatically analyzes failed runs to highlight the most likely root cause and provide a brief narrative of what went wrong. It uses visual context (screenshots) and page state to quickly surface issues so you can triage faster, with less guesswork.
When a run fails, Momentic reviews a playback of your recent steps and compares the state before and after key actions. It analyzes your run data including:
Screenshots before and after a step to spot overlays, misaligned elements, or unexpected UI changes
Page state and current URL to understand what the app was showing at each moment
Step descriptions and actions taken to understand what the test was attempting to do
Element targeting details to catch hidden/disabled elements or mismatched selectors
Error message and stack as helpful context for understanding the failure
The analysis reasons through the test execution, exploring how different factors might have contributed to the failure. It considers possibilities like an assertion failing because a modal overlapped a button, or navigation leaving the page in an unexpected state. It focuses on providing insights, possible fixes ranging from tests not using random values causing concurrency errors to tests using an irrelevant module, and gives a likely root cause of the test failure.
When running tests locally with failure analysis enabled (aiFailureAnalysis: true), the CLI provides:
Root cause analysis - A focused, detailed explanation of the failure (the RCA) when available
Error type - The classified reason for the failure
Fallback description - Basic error description when root cause analysis isn’t available
The CLI output focuses on actionable insights to help you understand and fix issues quickly during development. Root cause analysis appears only when the AI can provide it - otherwise it falls back to the standard error type and description.