airbnb / Showkase

🔦 Showkase is an annotation-processor based Android library that helps you organize, discover, search and visualize Jetpack Compose UI elements
https://medium.com/airbnb-engineering/introducing-showkase-a-library-to-organize-discover-and-visualize-your-jetpack-compose-elements-d5c34ef01095
Apache License 2.0
2.11k stars 107 forks source link

Provide more information when screenshotting fails #276

Closed elihart closed 1 year ago

elihart commented 1 year ago

We had someone report a screenshot test failure where the error was only "Failed to capture a node to bitmap. Reason: Expected exactly '1' node but found '2' nodes that satisfy: (isRoot)". The test name was a generic "composable_screenshot_test_210" because of how they're generated, and it was impossible to see what component was causing this.

This change wraps each error thrown in a screenshotting implementation with details on the component being tested to help debug in these cases