Slide 86
Slide 86 text
aim to break the layout
2
writing the snapshot test with pedrovgs/Shot
private fun ScreenshotTest.snapViewHolder(testItem: TrainingTestItem, snapshotName: String){
val activity = FontsizeActivityScenario.launchWith(testItem.fontScale
)
.waitForActivity(),
val view = waitForView {
val layout = activity.inflate(R.layout.training_row)
TrainingViewHolder(layout).apply
{
bind
(
trainingItem = testItem.trainingItem,
languageClickedListener = null
)
}
}
compareScreenshot {
holder = view,
widthInPx = testItem.viewWidth.widthInPx
,
name = snapshotName
}
}
Test itself