Created
February 7, 2022 20:47
-
-
Save loukwn/8438ac5d58da1730b131ffddfa655796 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewTests { | |
@get:Rule | |
val paparazzi = Paparazzi() // This can be configured to use different devices etc. | |
private lateinit var stageStepBar: StageStepBar | |
private lateinit var parentView: FrameLayout | |
private lateinit var testNameTextView: TextView | |
@Before | |
fun setup() { | |
parentView = paparazzi.inflate(R.layout.layout_to_test) | |
stageStepBar = parentView.findViewById(R.id.stageStepbar) | |
testNameTextView = parentView.findViewById(R.id.testName) | |
stageStepBar.setAnimate(false) | |
} | |
@Test | |
fun `Default configuration`() { | |
testNameTextView.text = "View test:\nDefault configuration" | |
paparazzi.snapshot(parentView) | |
} | |
@Test | |
fun `7 stages`() { | |
stageStepBar.setStageStepConfig(listOf(9, 9, 9, 9, 9, 9)) | |
testNameTextView.text = "View test:\n7 stages" | |
paparazzi.snapshot(parentView) | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment