Android-Testify usage
Android-Testify 3.x.x
Android-Testify 2.x.x
// Available from version 2.1.0+
androidTestImplementation 'com.github.sergio-sastre.AndroidUiTestingUtils:utils:<version>'
androidTestImplementation 'com.github.sergio-sastre.AndroidUiTestingUtils:android-testify:<version>'Activity
Fragment
@get:Rule
val screenshotRule =
ScreenshotRuleWithConfigurationForFragment(
exactness = 0.85f
fragmentClass = MyFragment::class.java,
fragmentArgs = bundleOf("key" to "value"),
config = FragmentConfigItem(
locale = "ar_XB",
theme = R.style.myCustomTheme,
uiMode = UiMode.NIGHT,
fontSize = FontSize.SMALL,
displaySize = DisplaySize.SMALL,
orientation = Orientation.LANDSCAPE
),
)
@ScreenshotInstrumentation
@Test
fun snapFragment() {
screenshotRule
.withExperimentalFeatureEnabled(GenerateDiffs)
.waitForIdleSync()
.assertSame(name = "nameOfMyScreenshot")
}Android View
Jetpack Compose
Last updated