How to test for visibility?

96 views
Skip to first unread message

Chris Merrill

unread,
Apr 6, 2016, 11:24:04 PM4/6/16
to TestFX
I'm asking "can the user see the node", not "does the node think it is visible".

My current test has a button that after pressing, is no longer visible to the user. It is still in the scene, but it is in a Parent which is in a StackPane with another Parent on top of it. So both the button and it's container think they are visible, but they are not visible TO THE USER. If I set a breakpoint in the test I can visually verify that the component is no longer visible on the screen, but this code fails:

        Assert.assertFalse(NodeQueryUtils.isVisible().apply(lookup("button1").query()));

Is there some other way to determine if a node can be seen on the display?

TIA!
Chris

Anirvan Sarkar

unread,
Apr 6, 2016, 11:55:44 PM4/6/16
to Chris Merrill, TestFX

FYI, there is a feature request for this in JDK bug system. See https://bugs.openjdk.java.net/browse/JDK-8153374

--
You received this message because you are subscribed to the Google Groups "TestFX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testfx-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages