Class GridPw
java.lang.Object
in.virit.mopo.GridPw
A helper class to work with the vaadin-grid component.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassRepresents a row in the vaadin-grid component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the index of the first visible rowintReturns the index of last visible row.intGets the total number of rows.getRow(int rowIndex) Returns a RowPw helper representing the row defined by the given index.booleanisRowInView(int rowIndex) Checks if the given row is in the visible viewport.voidscrollToIndex(int index) Scrolls the grid to the given index.voidselectRow(int rowIndex) Selects the given row.
-
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
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:
trueif the row is at least partially in view,falseotherwise
-
getLastVisibleRowIndex
public int getLastVisibleRowIndex()Returns the index of last visible row.- Returns:
- the index
-