Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Test: ApplicationTest() {
- ...
- private lateinit var textfield: TextField
- private lateinit var button: Button
- @Before
- fun setUpFx() {
- ...
- interact {
- ...
- textfield = from(view.root).lookup("#beep").query()
- button = from(view.root).lookup("#derp").query()
- }
- }
- ...
- @Test fun testTextfield() {
- clickOn(textfield).write("Something")
- assertEquals("Something", textfield.text)
- }
- @Test fun testButton() {
- assertTrue(button.isDisabled)
- clickOn(textfield).write("Something")
- assertTrue(!button.isDisabled)
- clickOn(button)
- }
- }
Add Comment
Please, Sign In to add comment