Module org.testfx

Class NodeQueryUtils


  • public final class NodeQueryUtils
    extends Object
    • Method Detail

      • rootsOfWindows

        public static Set<Node> rootsOfWindows​(Collection<Window> windows)
        Returns a set of the given windows' scenes' root nodes.
      • rootOfWindow

        public static Set<Node> rootOfWindow​(Window... windows)
        Returns a set of the given windows' scenes' root nodes.
      • rootOfStage

        public static Set<Node> rootOfStage​(Stage... stages)
        Returns a set of the given stages' scenes' root nodes.
      • rootOfScene

        public static Set<Node> rootOfScene​(Scene... scenes)
        Returns a set of the given scenes' root nodes.
      • rootOfPopupControl

        public static Set<Node> rootOfPopupControl​(PopupControl... popupControls)
        Returns a set of the given popup controls' scenes' root nodes.
      • byPredicate

        public static Function<Node,​Set<Node>> byPredicate​(Predicate<Node> predicate)
        Returns a function that returns a Set of all Nodes that pass the given predicate.
      • byMatcher

        public static Function<Node,​Set<Node>> byMatcher​(org.hamcrest.Matcher<Node> matcher)
        Returns a function that returns a Set of all Nodes that match the given matcher.
      • hasId

        public static Predicate<Node> hasId​(String id)
        Returns a predicate that returns true if the node's id equals the given id.
      • hasText

        public static Predicate<Node> hasText​(String text)
        Returns a predicate that returns true if the node is a Label, TextInputControl, or any of their subclasses whose text equals the given text.
      • matchesMatcher

        public static Predicate<Node> matchesMatcher​(org.hamcrest.Matcher<Node> matcher)
        Returns a predicate that returns true if the given node matches the given matcher.
      • isVisible

        public static Predicate<Node> isVisible()
        Returns a predicate that returns true if the given node is visible, the given tree is visible, or the node's local bounds are within its scene's bounds