Module org.testfx

Class NodeMatchers


  • public class NodeMatchers
    extends Object
    TestFX matchers for Node instances.
    • Method Summary

      Modifier and Type Method Description
      static org.hamcrest.Matcher<javafx.scene.Node> anything()
      Creates a matcher that matches everything (matches(Object) always returns true.
      static org.hamcrest.Matcher<javafx.scene.Node> hasChild​(String query)
      Creates a matcher that matches all Nodes that have at least one child node that is found via NodeQuery.lookup(String).
      static org.hamcrest.Matcher<javafx.scene.Node> hasChildren​(int amount, String query)
      Creates a matcher that matches all Nodes that have exactly amount child nodes that are found via NodeQuery.lookup(String).
      static org.hamcrest.Matcher<javafx.scene.Node> isDisabled()
      Creates a matcher that matches all disabled Nodes (i.e.
      static org.hamcrest.Matcher<javafx.scene.Node> isEnabled()
      Creates a matcher that matches all enabled Nodes (i.e.
      static org.hamcrest.Matcher<javafx.scene.Node> isFocused()
      Creates a matcher that matches all focused Nodes (i.e.
      static org.hamcrest.Matcher<javafx.scene.Node> isInvisible()
      Creates a matcher that matches all invisible Nodes.
      static org.hamcrest.Matcher<javafx.scene.Node> isNotFocused()
      Creates a matcher that matches all focused Nodes (i.e.
      static org.hamcrest.Matcher<javafx.scene.Node> isNotNull()
      Creates a matcher that matches all non-null Nodes.
      static org.hamcrest.Matcher<javafx.scene.Node> isNull()
      Creates a matcher that matches all null Nodes.
      static org.hamcrest.Matcher<javafx.scene.Node> isVisible()
      Creates a matcher that matches all visible Nodes.
    • Method Detail

      • anything

        public static org.hamcrest.Matcher<javafx.scene.Node> anything()
        Creates a matcher that matches everything (matches(Object) always returns true.
      • isNull

        public static org.hamcrest.Matcher<javafx.scene.Node> isNull()
        Creates a matcher that matches all null Nodes.
      • isNotNull

        public static org.hamcrest.Matcher<javafx.scene.Node> isNotNull()
        Creates a matcher that matches all non-null Nodes.
      • isVisible

        public static org.hamcrest.Matcher<javafx.scene.Node> isVisible()
        Creates a matcher that matches all visible Nodes.
      • isInvisible

        public static org.hamcrest.Matcher<javafx.scene.Node> isInvisible()
        Creates a matcher that matches all invisible Nodes.
      • isEnabled

        public static org.hamcrest.Matcher<javafx.scene.Node> isEnabled()
        Creates a matcher that matches all enabled Nodes (i.e. Node.isDisabled() returns false).
      • isDisabled

        public static org.hamcrest.Matcher<javafx.scene.Node> isDisabled()
        Creates a matcher that matches all disabled Nodes (i.e. Node.isDisabled() returns true).
      • isFocused

        public static org.hamcrest.Matcher<javafx.scene.Node> isFocused()
        Creates a matcher that matches all focused Nodes (i.e. Node.isFocused() returns true).
      • isNotFocused

        public static org.hamcrest.Matcher<javafx.scene.Node> isNotFocused()
        Creates a matcher that matches all focused Nodes (i.e. Node.isFocused() returns false).
      • hasChild

        public static org.hamcrest.Matcher<javafx.scene.Node> hasChild​(String query)
        Creates a matcher that matches all Nodes that have at least one child node that is found via NodeQuery.lookup(String).
      • hasChildren

        public static org.hamcrest.Matcher<javafx.scene.Node> hasChildren​(int amount,
                                                                          String query)
        Creates a matcher that matches all Nodes that have exactly amount child nodes that are found via NodeQuery.lookup(String).