You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying the example from the Readme and noticed that if I provide RoborazziRule.CaptureType.Gif() to the RoborazziRule then verifyRoborazziDebug task doesn't fail if any changes were applied to the UI. Also RoborazziRule.CaptureType.Gif() generates gifs on recordRoborazziDebug runs, if it matters.
In case I provide RoborazziRule.CaptureType.AllImage() task works well.
importandroidx.activity.ComponentActivityimportandroidx.compose.ui.test.junit4.createAndroidComposeRuleimportandroidx.compose.ui.test.onNodeWithTagimportandroidx.compose.ui.test.onRootimportandroidx.compose.ui.test.performClickimportcom.github.takahirom.roborazzi.RoborazziRuleimportorg.junit.Ruleimportorg.junit.Testimportorg.junit.runner.RunWithimportorg.robolectric.RobolectricTestRunnerimportorg.robolectric.annotation.Configimportorg.robolectric.annotation.GraphicsMode
@RunWith(RobolectricTestRunner::class)
@GraphicsMode(GraphicsMode.Mode.NATIVE)
@Config(manifest =Config.NONE)
classComposeTest {
@get:Rule
val composeTestRule = createAndroidComposeRule<ComponentActivity>()
@get:Rule
val roborazziRule =RoborazziRule(
composeRule = composeTestRule,
captureRoot = composeTestRule.onRoot(),
options =RoborazziRule.Options(
// RoborazziRule.CaptureType.Gif() // < -- If I provide this then verifyRoborazziDebug doesn't recognize any difference in the screenshotsRoborazziRule.CaptureType.AllImage()
)
)
@Test
funcomposable() {
composeTestRule.setContent {
SampleComposableFunction()
}
repeat(3) {
composeTestRule
.onNodeWithTag("AddBoxButton")
.performClick()
}
}
}
@Composable
funSampleComposableFunction() {
var count by remember { mutableIntStateOf(0) }
Column(
Modifier
.size(300.dp)
) {
Box(
Modifier
.testTag("AddBoxButton")
.size(50.dp)
.background(color =Color.Green)
.clickable {
count++
}
)
repeat(count) {
Spacer(modifier =Modifier.height(1.dp))
Box(
Modifier
.background(color =Color.Black)
.size(30.dp)
)
}
}
}
The text was updated successfully, but these errors were encountered:
Thank you for reporting this. Yes, we currently don't have a way to compare the GIFs. This would be a significant feature, as it would involve comparing frame counts, images, or other aspects. However, I'm not sure if this feature would be used frequently.
Thanks for the clarification and for your lib!
But it's quite strange to see a non-working example in the Readme.
Maybe add some notes about it to the Readme?
Thank you. I agree. The GIF feature was created at a very early stage of the library development, so the comparison feature did not exist at that time. It should be noted that we do not currently support comparison for GIFs. Thank you for your feedback.
I'm trying the example from the
Readme
and noticed that if I provideRoborazziRule.CaptureType.Gif()
to theRoborazziRule
thenverifyRoborazziDebug
task doesn't fail if any changes were applied to the UI. AlsoRoborazziRule.CaptureType.Gif()
generates gifs onrecordRoborazziDebug
runs, if it matters.In case I provide
RoborazziRule.CaptureType.AllImage()
task works well.The text was updated successfully, but these errors were encountered: