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

[Request] the test case names to be easier to recognize. #269

Closed oh-naoki closed 1 year ago

oh-naoki commented 1 year ago

Thank you for the great library! ☺️

I'm using Showkase for Screenshot testing and running on Firebase test lab. Showkase generates a test case like the following for each Preview. If there is a Preview that renders a Dialog, the test fails, but it is difficult to identify which Preview failed at that time. It would be helpful if you could assign name and group to the test case name! πŸ™‡β€β™‚οΈ

@Preview(name = "Sample1", group = "Sample")
@Composable
fun SamplePreview() {
    Column {
        ...
    }
}

↓ will generate by Showkase

@Test
public fun composable_screenshot_test_0(): Unit {
  takeComposableScreenshot(Showkase.getMetadata().componentList[0])
}
vinaygaba commented 1 year ago

This was addressed by this PR - https://github.com/airbnb/Showkase/commit/c7a8c5e0567ef3778110610dbece46d67a04c200

You should now have more information about which preview failed when the test fails