Class TreeGridElement

  • All Implemented Interfaces:
    com.vaadin.testbench.commands.CanCompareScreenshots, com.vaadin.testbench.commands.CanWaitForVaadin, com.vaadin.testbench.commands.TestBenchElementCommands, com.vaadin.testbench.HasDriver, com.vaadin.testbench.HasSearchContext, com.vaadin.testbench.HasTestBenchCommandExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebElement, org.openqa.selenium.WrapsElement

    public class TreeGridElement
    extends GridElement
    TestBench Element API for TreeGrid.
    Author:
    Vaadin Ltd
    • Constructor Detail

      • TreeGridElement

        public TreeGridElement()
    • Method Detail

      • expandWithClick

        public void expandWithClick​(int rowIndex)
        Expands the row at the given index in the grid. This expects the first column to have the hierarchy data.
        Parameters:
        rowIndex - 0-based row index to expand
        See Also:
        expandWithClick(int, int)
      • expandWithClick

        public void expandWithClick​(int rowIndex,
                                    int hierarchyColumnIndex)
        Expands the row at the given index in the grid with the given hierarchical column index.
        Parameters:
        rowIndex - 0-based row index to expand
        hierarchyColumnIndex - 0-based index of the hierarchy column
      • collapseWithClick

        public void collapseWithClick​(int rowIndex)
        Collapses the row at the given index in the grid. This expects the first column to have the hierarchy data.
        Parameters:
        rowIndex - 0-based row index to collapse
        See Also:
        collapseWithClick(int, int)
      • collapseWithClick

        public void collapseWithClick​(int rowIndex,
                                      int hierarchyColumnIndex)
        Collapses the row at the given index in the grid with the given hierarchical column index.
        Parameters:
        rowIndex - 0-based row index to collapse
        hierarchyColumnIndex - 0-based index of the hierarchy column
      • isRowExpanded

        public boolean isRowExpanded​(int rowIndex,
                                     int hierarchyColumnIndex)
        Returns whether the row at the given index is expanded or not.
        Parameters:
        rowIndex - 0-based row index
        hierarchyColumnIndex - 0-based index of the hierarchy column
        Returns:
        true if expanded, false if collapsed
      • isRowCollapsed

        public boolean isRowCollapsed​(int rowIndex,
                                      int hierarchyColumnIndex)
        Returns whether the row at the given index is collapsed or not.
        Parameters:
        rowIndex - 0-based row index
        hierarchyColumnIndex - 0-based index of the hierarchy column
        Returns:
        true if collapsed, false if expanded
      • hasExpandToggle

        public boolean hasExpandToggle​(int rowIndex,
                                       int hierarchyColumnIndex)
        Check whether the given indices correspond to a cell that contains a visible hierarchy toggle element.
        Parameters:
        rowIndex - 0-based row index
        hierarchyColumnIndex - 0-based index of the hierarchy column
        Returns:
        true if this cell has the expand toggle visible
      • getExpandElement

        public org.openqa.selenium.WebElement getExpandElement​(int rowIndex,
                                                               int hierarchyColumnIndex)
        Gets the expand/collapse element for the given row.
        Parameters:
        rowIndex - 0-based row index
        hierarchyColumnIndex - 0-based index of the hierarchy column
        Returns:
        the span element that is clicked for expanding/collapsing a rows
        Throws:
        org.openqa.selenium.NoSuchElementException - if there is no expand element for this row