Class GridProElement

  • All Implemented Interfaces:
    com.vaadin.testbench.commands.CanCompareScreenshots, com.vaadin.testbench.HasCallFunction, com.vaadin.testbench.HasDriver, com.vaadin.testbench.HasElementQuery, com.vaadin.testbench.HasPropertySettersGetters, 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 GridProElement
    extends com.vaadin.testbench.TestBenchElement
    A TestBench element representing a <vaadin-grid-pro> element.
    • Constructor Summary

      Constructors 
      Constructor Description
      GridProElement()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void generatedColumnIdsIfNeeded()  
      GridTHTDElement getCell​(int rowIndex, int colIndex)
      Gets the grid cell for the given row and column index.
      GridTHTDElement getCell​(int rowIndex, GridProColumnElement column)
      Gets the grid cell for the given row and column.
      int getFirstVisibleRowIndex()
      Gets the index of the first row which is at least partially visible.
      GridTHTDElement getHeaderCell​(int columnIndex)
      Gets the header cell for the given visible column index.
      com.vaadin.testbench.TestBenchElement getHeaderCellContent​(int rowIndex, int columnIndex)
      Finds the vaadin-grid-cell-content element for the given row and column in header.
      int getLastVisibleRowIndex()
      Gets the index of the last row which is at least partially visible.
      GridTRElement getRow​(int rowIndex)
      Gets the tr element for the given row index.
      List<GridProColumnElement> getVisibleColumns()
      Gets the currently visible columns in the grid, including any selection checkbox column.
      void scrollToRow​(int row)
      Scrolls to the row with the given index.
      • Methods inherited from class com.vaadin.testbench.TestBenchElement

        callFunction, clear, click, click, compareScreen, compareScreen, compareScreen, contextClick, dispatchEvent, dispatchEvent, doubleClick, equals, executeScript, findElement, findElements, focus, getAttribute, getCapabilities, getClassNames, getCommandExecutor, getContext, getCssValue, getDriver, getLocation, getProperty, getPropertyBoolean, getPropertyDouble, getPropertyElement, getPropertyElements, getPropertyInteger, getPropertyString, getRect, getScreenshotAs, getSize, getTagName, getText, getWrappedElement, hasAttribute, hasClassName, hashCode, init, init, isChrome, isDisplayed, isEnabled, isFirefox, isIE, isSelected, scroll, scrollIntoView, scrollLeft, sendKeys, setProperty, setProperty, setProperty, setProperty, submit, waitForVaadin, waitUntil, waitUntil, wrap, wrapElement, wrapElements
      • Methods inherited from interface com.vaadin.testbench.HasElementQuery

        $, $
      • Methods inherited from interface org.openqa.selenium.WebElement

        getAccessibleName, getAriaRole, getDomAttribute, getDomProperty, getShadowRoot
    • Constructor Detail

      • GridProElement

        public GridProElement()
    • Method Detail

      • scrollToRow

        public void scrollToRow​(int row)
        Scrolls to the row with the given index.
        Parameters:
        row - the row to scroll to
      • getFirstVisibleRowIndex

        public int getFirstVisibleRowIndex()
        Gets the index of the first row which is at least partially visible.
        Returns:
        the index of the first visible row
      • getCell

        public GridTHTDElement getCell​(int rowIndex,
                                       int colIndex)
        Gets the grid cell for the given row and column index.

        For the column index, only visible columns are taken into account.

        Automatically scrolls the given row into view

        Parameters:
        rowIndex - the row index
        colIndex - the column index
        Returns:
        the grid cell for the given coordinates
      • getCell

        public GridTHTDElement getCell​(int rowIndex,
                                       GridProColumnElement column)
        Gets the grid cell for the given row and column.

        Automatically scrolls the given row into view

        Parameters:
        rowIndex - the row index
        column - the column element for the column
        Returns:
        the grid cell for the given coordinates
      • getLastVisibleRowIndex

        public int getLastVisibleRowIndex()
        Gets the index of the last row which is at least partially visible.
        Returns:
        the index of the last visible row
      • getHeaderCell

        public GridTHTDElement getHeaderCell​(int columnIndex)
        Gets the header cell for the given visible column index.
        Parameters:
        columnIndex - the index of the column
        Returns:
        a cell element for the header cell
      • getHeaderCellContent

        public com.vaadin.testbench.TestBenchElement getHeaderCellContent​(int rowIndex,
                                                                          int columnIndex)
        Finds the vaadin-grid-cell-content element for the given row and column in header.
        Parameters:
        rowIndex - the index of the row in the header
        columnIndex - the index of the column in the header
        Returns:
        the vaadin-grid-cell-content element for the given row and column in header.
      • getRow

        public GridTRElement getRow​(int rowIndex)
        Gets the tr element for the given row index.
        Parameters:
        rowIndex - the row index
        Returns:
        the tr element for the row
      • generatedColumnIdsIfNeeded

        protected void generatedColumnIdsIfNeeded()
      • getVisibleColumns

        public List<GridProColumnElement> getVisibleColumns()
        Gets the currently visible columns in the grid, including any selection checkbox column.
        Returns:
        a list of grid column elements which can be used to refer to the given column