Class TreeElement


  • public class TreeElement
    extends BaseElement
    Page object used to interact with the generic tree widget available in XWiki.
    Since:
    6.3RC1
    Version:
    $Id: 29486202e180b33e2a1e851f3f89b5319c7169e4 $
    • Constructor Detail

      • TreeElement

        public TreeElement​(org.openqa.selenium.WebElement element)
        Creates a new instance that can be used to interact with the tree represented by the given element.
        Parameters:
        element - the element that represents the tree
    • Method Detail

      • getNode

        public TreeNodeElement getNode​(String nodeId)
        Parameters:
        nodeId - the node identifier
        Returns:
        the node with the specified identifier
      • hasNode

        public boolean hasNode​(String nodeId)
        Parameters:
        nodeId - the node identifier
        Returns:
        true if the specified node is present (loaded), false otherwise
      • openTo

        public TreeElement openTo​(String nodeId)
        Open the tree to the specified node and select it.
        Parameters:
        nodeId - the node to open to
        Returns:
        this tree
      • clearSelection

        public TreeElement clearSelection()
        Clear the selection in the tree.
        Returns:
        this tree
        Since:
        7.2M3
      • waitForIt

        public TreeElement waitForIt()
        Wait as long as the tree in busy (loading).
        Returns:
        this tree
      • waitForNodeSelected

        public TreeElement waitForNodeSelected​(String nodeId)
        Waits for the specified node to be selected.
        Parameters:
        nodeId - the id of the node to wait for
        Returns:
        this tree
        Since:
        7.2
      • getElement

        protected org.openqa.selenium.WebElement getElement()
      • getSelectedNodeIDs

        public List<String> getSelectedNodeIDs()
        Returns:
        the list of selected node IDs.
      • getNodeIDs

        public List<String> getNodeIDs()
        Returns:
        a list of loaded node IDs.
      • selectNodes

        public void selectNodes​(TreeNodeElement... nodes)
        Allow to select multiple nodes at once by maintaining ctrl key pressed while clicking on nodes.
        Parameters:
        nodes - the nodes to select.
        Since:
        13.3RC1
      • getTopLevelNodes

        public List<TreeNodeElement> getTopLevelNodes()
        Returns:
        the list of top level nodes