Class GridPw

java.lang.Object
in.virit.mopo.GridPw

public class GridPw extends Object
A helper class to work with the vaadin-grid component.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    Represents a row in the vaadin-grid component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GridPw(com.microsoft.playwright.Locator gridLocator)
    Creates a Grid page object for the given grid locator.
    GridPw(com.microsoft.playwright.Page page)
    Creates a Grid page object for the first grid on the page.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the index of the first visible row
    int
    Returns the index of last visible row.
    int
    Gets the total number of rows.
    getRow(int rowIndex)
    Returns a RowPw helper representing the row defined by the given index.
    boolean
    isRowInView(int rowIndex)
    Checks if the given row is in the visible viewport.
    void
    scrollToIndex(int index)
    Scrolls the grid to the given index.
    void
    selectRow(int rowIndex)
    Selects the given row.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GridPw

      public GridPw(com.microsoft.playwright.Locator gridLocator)
      Creates a Grid page object for the given grid locator.
      Parameters:
      gridLocator - the Playwright locator for the grid
    • GridPw

      public GridPw(com.microsoft.playwright.Page page)
      Creates a Grid page object for the first grid on the page.
      Parameters:
      page - the Playwright page
  • Method Details

    • getRenderedRowCount

      public int getRenderedRowCount()
      Gets the total number of rows.
      Returns:
      the number of rows
    • getFirstVisibleRowIndex

      public int getFirstVisibleRowIndex()
      Returns the index of the first visible row
      Returns:
      the index.
    • scrollToIndex

      public void scrollToIndex(int index)
      Scrolls the grid to the given index.
      Parameters:
      index - the row index to scroll to
    • selectRow

      public void selectRow(int rowIndex)
      Selects the given row.
      Parameters:
      rowIndex - the row index to select
    • getRow

      public GridPw.RowPw getRow(int rowIndex)
      Returns a RowPw helper representing the row defined by the given index.
      Parameters:
      rowIndex - the row index
      Returns:
      the RowPw for editing the UI state or to get cell locators for assertions.
    • isRowInView

      public boolean isRowInView(int rowIndex)
      Checks if the given row is in the visible viewport.
      Parameters:
      rowIndex - the row to check
      Returns:
      true if the row is at least partially in view, false otherwise
    • getLastVisibleRowIndex

      public int getLastVisibleRowIndex()
      Returns the index of last visible row.
      Returns:
      the index