```class Test: ApplicationTest() { override f...
# tornadofx
a
Copy code
class Test: ApplicationTest() {

    override fun start(stage: Stage?) {
        setInScope(CatScheduleModel(), CatScheduleScope())
        val sceneRoot = Editor().root
        addAllIdsToDescendents(sceneRoot)
        stage?.scene = Scene(sceneRoot, 100.0, 100.0)
        stage?.show()
    }
    .....
    @Test fun testTextfield() {
        val textfield = lookup("#beep") as TextField
        verifyThat("#beep", hasText(textfield.text))
    }
}
c
Looks like you are instantiating Editor directly. I'm guessing it's not picking up the global scope from that. Try
find<Editor>()
Isn't that one of the penalties on your monopoly game? 😄
😀 2
a
hahaha I'll add that one to the list 😄
@Carlton Whitehead Originally, I had
find<Editor>(CatScheduleScope())
, but what I'd like to be able to do is save the nodes so I can use their properties and methods to test them
c
TestFX can query the nodes by ID, class, and other criteria
a
Right - so I originally had JUST
val stage = FXToolkit.registerPrimaryStage()
and then
find<Editor>(CatScheduleScope())
in the
testTextField()
method, but in my debugging, it kind of looked like no stage was being attached because the call to lookup the node kept returning
null