Class GridElement
- All Implemented Interfaces:
Findable<ComponentQuery<GridElement>>,FocusableElement,HasEnabledElement,HasLocatorElement,HasStyleElement,HasThemeElement
- Direct Known Subclasses:
TreeGridElement
<vaadin-grid>.
Provides helpers for scrolling, querying visible rows, accessing cell content, and interacting with the grid's header, body and selection. Cell access uses JavaScript evaluation on the grid's internal APIs since body cells live in shadow DOM and are virtualized.
A column index counts the visible (non-hidden) columns in display order,
from 0 on the left: hidden columns are skipped, a selection column counts,
and after the user drags a column to a new place the indexes follow the
new order. A column without header text can be found by its id
(Column.setId(..)) with getColumnIndexById(String).
Counting the selection column matches TestBench's GridElement; Flow's
Grid.getColumns() and browserless tests leave it out, so in a multi-select
grid their index is one less.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassRepresents a cell in the grid, providing access to the table cell (td or th), the cell content (vaadin-grid-cell-content) and the column index.classRepresents a footer cell in the grid, providing access to the table cell (td) and the cell content.classRepresents a header cell in the grid, providing access to the table cell (th), the cell content and sorting.classRepresents a row in the grid, providing access to the row locator, row index, and methods for accessing cells and interacting with the row (selection, details).static enumThe sort direction of a grid column, as itsvaadin-grid-sortershows it:ASCENDING,DESCENDINGorNONE. -
Field Summary
FieldsFields inherited from class org.vaadin.addons.dramafinder.element.VaadinElement
locator -
Constructor Summary
ConstructorsConstructorDescriptionGridElement(com.microsoft.playwright.Locator locator) Create a newGridElement. -
Method Summary
Modifier and TypeMethodDescriptionvoidAssert thatallRowsVisibleis enabled.voidassertCellContent(int row, int column, String expected) Assert that the body cell at the given row and column has the given text content.voidassertCellContent(int row, String columnHeaderText, String expected) Assert that the body cell at the given row and column header has the given text content.voidassertCellNotPresent(int row, int column) Assert that no cell exists at the given row and column.voidassertCellPresent(int row, int column) Assert that a cell exists at the given row and column.voidassertColumnCount(int expected) Assert that the grid has the given number of visible (non-hidden) columns.voidassertColumnNotPresent(String headerText) Assert that no column with the given header text exists.voidassertColumnPresent(String headerText) Assert that a column with the given header text exists.voidAssert that column reordering is allowed.voidAssert that column reordering is not allowed.voidassertDetailsClosed(int rowIndex) Assert that the details panel of the row at the given index is closed.voidassertDetailsOpen(int rowIndex) Assert that the details panel of the row at the given index is open.voidAssert that the grid has no rows.voidassertFooterCell(int column, String expected) Assert that the footer cell at the given column has the given text content.voidassertFooterCellContents(String... expected) Assert that the visible footer cells have exactly the given text contents, in order.voidassertFooterNotPresent(String footerText) Assert that no footer cell with the given text exists.voidassertFooterPresent(String footerText) Assert that a footer cell with the given text exists.voidassertHeaderCell(int column, String expected) Assert that the header cell at the given column has the given text content.voidassertHeaderCellContents(String... expected) Assert that the visible header cells have exactly the given text contents, in order.voidAssert that multi-sort is enabled.voidAssert thatallRowsVisibleis not enabled.voidAssert that multi-sort is not enabled.voidassertRowCount(int expected) Assert that the grid has the given total number of rows (data items).voidassertRowIndexesWithColumnText(int column, String text, Integer... expected) Assert that the cells in the given column with the given text appear at exactly the given row indexes.voidassertRowInView(int rowIndex) Assert that the row with the given index is currently scrolled into view.voidassertRowNotInView(int rowIndex) Assert that the row with the given index is not currently scrolled into view.voidassertRowNotPresent(int rowIndex) Assert that no row exists at the given index.voidassertRowNotSelected(int rowIndex) Assert that the row at the given index is not selected.voidassertRowPresent(int rowIndex) Assert that a row exists at the given index (auto-scrolling if necessary).voidassertRowSelected(int rowIndex) Assert that the row at the given index is selected.voidAssert that the select-all checkbox is checked.voidAssert that the select-all checkbox is indeterminate.voidAssert that the select-all checkbox is unchecked.voidassertSelectedItemCount(int expected) Assert that the given number of items are currently selected.voidCheck the select-all checkbox.protected voidClick the given cell to toggle the selection of its row.protected voidToggle the selection of a row by clicking it like a user would.protected voidClose the details of a row by clicking it (seeGridElement.RowElement.click()), which relies on the grid toggling details on click: Flow'sGrid.setDetailsVisibleOnClick(true), the default.voiddeselect(int rowIndex) Deselect a row by index, clicking it like a user would.protected voidDeselect the row.findCell(int row, int column) Find a body cell by row index and column index.Find a body cell by row index and column header text.Find the index of the visible column with the given id, the one set withColumn.setId(..)in Flow.findFooterCell(int columnIndex) Find a footer cell by column index.findFooterCell(int footerRowIndex, int columnIndex) Find a footer cell by footer row index and column index.findFooterCellByText(int footerRowIndex, String text) Find a footer cell by footer row index and text content.findFooterCellByText(String text) Find a footer cell by its text content.findHeaderCell(int columnIndex) Find a header cell by column index.findHeaderCell(int headerRowIndex, int columnIndex) Find a header cell by header row index and column index.findHeaderCellByText(int headerRowIndex, String text) Find a header cell by header row index and text content.findHeaderCellByText(String text) Find a header cell by its text content.findRow(int rowIndex) Find a row by its index.protected Optional<GridElement.RowElement> findRow(int rowIndex, int headerRowCount) Find a row by its index, given the number of header rows.findRowIndexesWithColumnText(int columnIndex, String text) Find row indexes where the cell in the given column has the given text.static GridElementget(com.microsoft.playwright.Locator parent) Get the firstGridElementwithin a parent locator.static GridElementget(com.microsoft.playwright.Page page) Get the firstGridElementon the page.static GridElementGet aGridElementby itsid, scoped to the given locator.static GridElementGet aGridElementby itsid, searching the entire page.static GridElementgetByTestId(com.microsoft.playwright.Locator locator, String testId) Get aGridElementby its test id, scoped to the given locator.static GridElementgetByTestId(com.microsoft.playwright.Page page, String testId) Get aGridElementby its test id, searching the entire page.intGet the number of visible (non-hidden) columns.intGet the index of the visible column with the given id, for a column that must exist.getColumnTexts(int columnIndex) Read the rendered text of every body cell in the given column, from the first row to the last.Get the text content of all visible footer cells.protected intGet the number of footer rows.Get the text content of all visible header cells.getHeaderCells(int columnIndex) Get the header cells of a column in every header row, top row first: the cell of the column itself and those of the column groups around it.protected intGet the number of header rows.intGet the number of rows currently rendered in the DOM.intGet the number of currently selected items.intGet the total number of rows (data items) in the grid.booleanWhether the grid hasallRowsVisibleenabled.booleanWhether column reordering is allowed.booleanWhether the grid has multi-sort enabled.booleanisRowInView(int rowIndex) Whether the row with the given index is currently scrolled into view (at least partially visible between the header and footer), without triggering any scrolling.booleanCheck if the select-all checkbox is checked.booleanCheck if the select-all checkbox is indeterminate.booleanCheck if the select-all checkbox is unchecked.protected booleanmatchesCellContent(GridElement.CellElement cell, String text) Deprecated, for removal: This API element is subject to removal in a future version.protected booleanmatchesCellText(String cellText, String text) Determine if a body cell's rendered text matches the given text.protected booleanmatchesFooterCell(GridElement.CellElement cell, String text) Determine if a footer cell matches the given text.protected booleanmatchesHeaderCell(GridElement.CellElement cell, String text) Determine if a header cell matches the given text.protected voidOpen the details of a row by clicking it (seeGridElement.RowElement.click()), which relies on the grid toggling details on click: Flow'sGrid.setDetailsVisibleOnClick(true), the default.voidScroll to the very end of the grid.voidscrollToRow(int rowIndex) Scroll the grid so that the given row index becomes visible.voidScroll to the very beginning of the grid.voidselect(int rowIndex) Select a row by index, clicking it like a user would.protected voidSelect the row.voidUncheck the select-all checkbox.voidWait for the grid to finish loading after a scroll or other action that triggers loading of new rows.Methods inherited from class org.vaadin.addons.dramafinder.element.VaadinElement
assertHidden, assertVisible, assertVisible, click, find, getLocator, getProperty, getText, isHidden, isVisible, isVisible, setPropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.vaadin.addons.dramafinder.element.shared.FocusableElement
assertIsFocused, assertIsNotFocused, blur, focus, getFocusLocator, getTabIndexMethods inherited from interface org.vaadin.addons.dramafinder.element.shared.HasEnabledElement
assertDisabled, assertEnabled, assertEnabled, getEnabledLocator, isEnabled, isEnabledMethods inherited from interface org.vaadin.addons.dramafinder.element.shared.HasLocatorElement
getLocator, waitAfterAction, waitForVaadinIdleMethods inherited from interface org.vaadin.addons.dramafinder.element.shared.HasStyleElement
assertCssClass, getCssClassMethods inherited from interface org.vaadin.addons.dramafinder.element.shared.HasThemeElement
assertHasNoThemeVariant, assertHasThemeVariant, assertTheme, getTheme
-
Field Details
-
FIELD_TAG_NAME
- See Also:
-
-
Constructor Details
-
GridElement
public GridElement(com.microsoft.playwright.Locator locator) Create a newGridElement.- Parameters:
locator- the locator for the<vaadin-grid>element
-
-
Method Details
-
get
Get the firstGridElementon the page.- Parameters:
page- the Playwright page- Returns:
- the first matching
GridElement
-
get
Get the firstGridElementwithin a parent locator.- Parameters:
parent- the parent locator to search within- Returns:
- the first matching
GridElement
-
getRenderedRowCount
public int getRenderedRowCount()Get the number of rows currently rendered in the DOM. This may be less than the total row count due to virtualization.- Returns:
- count of rows currently rendered in the DOM
-
getTotalRowCount
public int getTotalRowCount()Get the total number of rows (data items) in the grid.- Returns:
- total item count
-
getColumnCount
public int getColumnCount()Get the number of visible (non-hidden) columns.- Returns:
- visible column count
-
findColumnIndexById
Find the index of the visible column with the given id, the one set withColumn.setId(..)in Flow. The index counts visible columns in display order (see the class description), so it can be passed tofindCell(int, int)orfindHeaderCell(int). A column key (Column.setKey(..)) stays on the server and cannot be found this way.- Parameters:
id- the column id, matched exactly- Returns:
- the 0-based column index; empty if no visible column has that id (the column does not exist or is hidden)
-
getColumnIndexById
Get the index of the visible column with the given id, for a column that must exist.findColumnIndexById(String)is the variant that may find none.- Parameters:
id- the column id, matched exactly- Returns:
- the 0-based column index, in display order
- Throws:
IllegalArgumentException- if no visible column has that id
-
isAllRowsVisible
public boolean isAllRowsVisible()Whether the grid hasallRowsVisibleenabled.- Returns:
trueif all rows are visible (no vertical scroll)
-
isMultiSort
public boolean isMultiSort()Whether the grid has multi-sort enabled.- Returns:
trueif multi-sort is enabled
-
isColumnReorderingAllowed
public boolean isColumnReorderingAllowed()Whether column reordering is allowed.- Returns:
trueif column reordering is allowed
-
getHeaderRowCount
protected int getHeaderRowCount()Get the number of header rows. Usually 1, but can be more if there are column groups.- Returns:
- header row count
-
findHeaderCell
Find a header cell by column index. Uses first header row.- Parameters:
columnIndex- 0-based visible column index- Returns:
- optional header cell element. Empty if no header cell exists at the given column index.
-
findHeaderCell
Find a header cell by header row index and column index.- Parameters:
headerRowIndex- 0-based header row index. Use 0 for the first header row, 1 for the second, etc.columnIndex- 0-based visible column index.- Returns:
- optional header cell element. Empty if no header cell exists at the given header row and column index.
-
findHeaderCellByText
Find a header cell by its text content. Uses first header row.- Parameters:
text- the header text to find- Returns:
- optional header cell element. Empty if no header cell with the given text is found.
-
findHeaderCellByText
public Optional<GridElement.HeaderCellElement> findHeaderCellByText(int headerRowIndex, String text) Find a header cell by header row index and text content.- Parameters:
headerRowIndex- 0-based header row index. Use 0 for the first header row, 1 for the second, etc.text- the header text to find- Returns:
- optional header cell element. Empty if no header cell with the given text is found in the given header row.
-
getHeaderCells
Get the header cells of a column in every header row, top row first: the cell of the column itself and those of the column groups around it. In Flow these are the column's cells in everyHeaderRow, e.g. a joined group header above and a filter field in an appended row below; a cell joined over several columns is returned for each column it spans. Scope a lookup toGridElement.CellElement.getCellContentLocator()to reach a component in a cell. Every returned cell reportscolumnIndexas its column index.- Parameters:
columnIndex- 0-based visible column index, in display order (see the class description)- Returns:
- the header cells, top row first, leaving out header rows the grid hides because all their cells are empty; empty if the column has no shown header cell
- Throws:
IllegalArgumentException- if the column index is negative or no visible column has it
-
getHeaderCellContents
Get the text content of all visible header cells.- Returns:
- list of header cell text contents
-
matchesHeaderCell
Determine if a header cell matches the given text. By default, compares the trimmed innerText of the cell content. Can be overridden for custom matching logic (e.g. ignoring case, or matching only a part of the text).- Parameters:
cell- the header cell to checktext- the header text to match- Returns:
trueif the cell matches the text,falseotherwise
-
findCell
Find a body cell by row index and column index.- Parameters:
row- row index, starting from 0.column- column index, starting from 0.- Returns:
- optional cell element. Empty if no cell exists at the given row and column index.
-
findCell
Find a body cell by row index and column header text.- Parameters:
row- row index, starting from 0.columnHeaderText- the header text of the column to find.- Returns:
- optional cell element. Empty if no cell exists at the given row and column header text.
-
findRowIndexesWithColumnText
Find row indexes where the cell in the given column has the given text. Reads the column a rendered page of rows at a time (seegetColumnTexts(int)), so a lazy grid is scrolled once per page rather than once per row; each cell is compared withmatchesCellText(String, String).- Parameters:
columnIndex- the column index to check the cell content in, starting from 0.text- the text to match in the cell content.- Returns:
- list of row indexes where the cell in the given column matches the given text. Empty list if no match is found.
-
getColumnTexts
Read the rendered text of every body cell in the given column, from the first row to the last. The grid is read a page at a time: one script reads all rows rendered at once, then the grid jumps to the first row not read yet and waits for it to load. A lazy grid therefore costs one scroll and one round trip per page instead of several per row. A row that is still not rendered after the jump is looked up on its own, asfindRow(int)does. Leaves the grid scrolled to wherever the last page was.- Parameters:
columnIndex- the column index, starting from 0.- Returns:
- the cell texts (the
innerTextof the cell content), indexed by row; an entry isnullwhen that row could not be rendered. Empty for an empty grid. - Throws:
IllegalArgumentException- if the column index is negative, or the grid has rows and the column does not exist
-
findRow
Find a row by its index. Scrolls the grid if necessary to find the row.- Parameters:
rowIndex- row index, starting from 0.- Returns:
- optional row element. Empty if no row exists at the given index.
-
findRow
Find a row by its index, given the number of header rows.- Parameters:
rowIndex- row index, starting from 0.headerRowCount- number of header rows in the grid, used to calculate the aria-rowIndex for finding the row.- Returns:
- optional row element. Empty if no row exists at the given index.
-
matchesCellContent
@Deprecated(since="2.0.1", forRemoval=true) protected boolean matchesCellContent(GridElement.CellElement cell, String text) Deprecated, for removal: This API element is subject to removal in a future version.findRowIndexesWithColumnText(int, String)reads a whole column at once and no longer calls this method; overridematchesCellText(String, String)to customise matching.Determine if a body cell matches the given text, by comparing its rendered text withmatchesCellText(String, String).- Parameters:
cell- the body cell to checktext- the text to match in the cell content- Returns:
trueif the cell matches the text,falseotherwise
-
matchesCellText
Determine if a body cell's rendered text matches the given text. By default, the two must be equal. Override for custom matching logic (e.g. ignoring case, or matching only a part of the text).- Parameters:
cellText- theinnerTextof the cell content, nevernulltext- the text to match- Returns:
trueif the cell text matches,falseotherwise
-
scrollToRow
public void scrollToRow(int rowIndex) Scroll the grid so that the given row index becomes visible. Waits for the row to be rendered in the DOM before returning.- Parameters:
rowIndex- the 0-based row index to scroll to
-
scrollToStart
public void scrollToStart()Scroll to the very beginning of the grid. -
scrollToEnd
public void scrollToEnd()Scroll to the very end of the grid. -
select
public void select(int rowIndex) Select a row by index, clicking it like a user would. Does nothing if the row is already selected.- Parameters:
rowIndex- index of the row to select, starting from 0.- Throws:
IllegalArgumentException- if no row exists at the given indexAssertionError- if the row is not selected after the click, e.g. because the grid has no selection or the server rejected it
-
select
Select the row. You can override this method to implement custom selection logic, for example if you want to select by clicking some other cell than the first one, or if you want to use some modifier keys for selection.- Parameters:
row- row to select.- Throws:
AssertionError- if the row is not selected after the click
-
deselect
public void deselect(int rowIndex) Deselect a row by index, clicking it like a user would. Does nothing if the row is not selected.- Parameters:
rowIndex- index of the row to deselect, starting from 0.- Throws:
IllegalArgumentException- if no row exists at the given indexAssertionError- if the row is still selected after the click, e.g. because the grid does not allow deselecting
-
deselect
Deselect the row. You can override this method to implement custom selection logic, for example if you want to deselect by clicking some other cell than the first one, or if you want to use some modifier keys for deselection.- Parameters:
row- row to deselect.- Throws:
AssertionError- if the row is still selected after the click
-
clickRowForSelection
Toggle the selection of a row by clicking it like a user would. Clicks the selection checkbox of the first cell when there is one. Otherwise clicks the first cell that has a spot where a click reaches the grid rather than a component rendered in the cell, usually its padding, so a cell holding a link or a button still selects the row: the grid ignores clicks on links, buttons and other focusable content, which would only trigger that component. You can override this method to choose the cell to click yourself.- Parameters:
row- row to select or deselect- Throws:
IllegalStateException- if interactive content covers every cell of the row, padding included
-
clickCellForSelection
Click the given cell to toggle the selection of its row. Clicks the selection checkbox when the cell holds one, otherwise a spot of the cell that is not covered by interactive content, typically its padding. You can override this method to implement custom selection logic for given cell.- Parameters:
cell- the body cell to click- Throws:
IllegalStateException- if interactive content covers the whole cell, padding included
-
getSelectedItemCount
public int getSelectedItemCount()Get the number of currently selected items.- Returns:
- selected item count
-
isSelectAllChecked
public boolean isSelectAllChecked()Check if the select-all checkbox is checked.- Returns:
trueif the select-all checkbox is checked (and not indeterminate),falseotherwise
-
isSelectAllIndeterminate
public boolean isSelectAllIndeterminate()Check if the select-all checkbox is indeterminate.- Returns:
trueif the select-all checkbox is indeterminate,falseotherwise
-
isSelectAllUnchecked
public boolean isSelectAllUnchecked()Check if the select-all checkbox is unchecked.- Returns:
trueif the select-all checkbox is unchecked,falseotherwise
-
checkSelectAll
public void checkSelectAll()Check the select-all checkbox. Does nothing if the select-all checkbox is already checked. -
uncheckSelectAll
public void uncheckSelectAll()Uncheck the select-all checkbox. Does nothing if the select-all checkbox is already unchecked. -
openDetails
Open the details of a row by clicking it (seeGridElement.RowElement.click()), which relies on the grid toggling details on click: Flow'sGrid.setDetailsVisibleOnClick(true), the default. Does nothing if the details are already open. In a single-select grid the click also selects the row. Override this method if the details are opened another way, for example by a button.- Parameters:
row- row for which to open details- Throws:
AssertionError- if the details are not open after the click
-
closeDetails
Close the details of a row by clicking it (seeGridElement.RowElement.click()), which relies on the grid toggling details on click: Flow'sGrid.setDetailsVisibleOnClick(true), the default. Does nothing if the details are already closed. Override this method if the details are closed another way, for example by a button.- Parameters:
row- row for which to close details- Throws:
AssertionError- if the details are still open after the click
-
waitForGridToStopLoading
public void waitForGridToStopLoading()Wait for the grid to finish loading after a scroll or other action that triggers loading of new rows. Returns without waiting when the grid is no longer in the DOM, e.g. because a click on a cell navigated to another view. -
isRowInView
public boolean isRowInView(int rowIndex) Whether the row with the given index is currently scrolled into view (at least partially visible between the header and footer), without triggering any scrolling.- Parameters:
rowIndex- row index, starting from 0.- Returns:
trueif the row is rendered and at least partially visible,falseotherwise
-
assertRowCount
public void assertRowCount(int expected) Assert that the grid has the given total number of rows (data items).- Parameters:
expected- the expected total row count
-
assertEmpty
public void assertEmpty()Assert that the grid has no rows. -
assertColumnCount
public void assertColumnCount(int expected) Assert that the grid has the given number of visible (non-hidden) columns.- Parameters:
expected- the expected visible column count
-
assertAllRowsVisible
public void assertAllRowsVisible()Assert thatallRowsVisibleis enabled. -
assertNotAllRowsVisible
public void assertNotAllRowsVisible()Assert thatallRowsVisibleis not enabled. -
assertMultiSort
public void assertMultiSort()Assert that multi-sort is enabled. -
assertNotMultiSort
public void assertNotMultiSort()Assert that multi-sort is not enabled. -
assertColumnReorderingAllowed
public void assertColumnReorderingAllowed()Assert that column reordering is allowed. -
assertColumnReorderingNotAllowed
public void assertColumnReorderingNotAllowed()Assert that column reordering is not allowed. -
assertCellContent
Assert that the body cell at the given row and column has the given text content. Auto-scrolls the grid if necessary to bring the row into view.- Parameters:
row- row index, starting from 0.column- column index, starting from 0.expected- the expected cell text content
-
assertCellContent
Assert that the body cell at the given row and column header has the given text content. Auto-scrolls the grid if necessary to bring the row into view.- Parameters:
row- row index, starting from 0.columnHeaderText- the header text of the column.expected- the expected cell text content
-
assertCellPresent
public void assertCellPresent(int row, int column) Assert that a cell exists at the given row and column.- Parameters:
row- row index, starting from 0.column- column index, starting from 0.
-
assertCellNotPresent
public void assertCellNotPresent(int row, int column) Assert that no cell exists at the given row and column.- Parameters:
row- row index, starting from 0.column- column index, starting from 0.
-
assertHeaderCellContents
Assert that the visible header cells have exactly the given text contents, in order.- Parameters:
expected- the expected header cell text contents
-
assertHeaderCell
Assert that the header cell at the given column has the given text content.- Parameters:
column- column index, starting from 0.expected- the expected header cell text content
-
assertColumnPresent
Assert that a column with the given header text exists.- Parameters:
headerText- the header text to look for
-
assertColumnNotPresent
Assert that no column with the given header text exists.- Parameters:
headerText- the header text to look for
-
assertRowPresent
public void assertRowPresent(int rowIndex) Assert that a row exists at the given index (auto-scrolling if necessary).- Parameters:
rowIndex- row index, starting from 0.
-
assertRowNotPresent
public void assertRowNotPresent(int rowIndex) Assert that no row exists at the given index.- Parameters:
rowIndex- row index, starting from 0.
-
assertRowInView
public void assertRowInView(int rowIndex) Assert that the row with the given index is currently scrolled into view.- Parameters:
rowIndex- row index, starting from 0.
-
assertRowNotInView
public void assertRowNotInView(int rowIndex) Assert that the row with the given index is not currently scrolled into view.- Parameters:
rowIndex- row index, starting from 0.
-
assertRowIndexesWithColumnText
Assert that the cells in the given column with the given text appear at exactly the given row indexes.- Parameters:
column- column index, starting from 0.text- the text to match in the cell content.expected- the expected row indexes (in order)
-
assertSelectedItemCount
public void assertSelectedItemCount(int expected) Assert that the given number of items are currently selected.- Parameters:
expected- the expected selected item count
-
assertRowSelected
public void assertRowSelected(int rowIndex) Assert that the row at the given index is selected.- Parameters:
rowIndex- row index, starting from 0.
-
assertRowNotSelected
public void assertRowNotSelected(int rowIndex) Assert that the row at the given index is not selected.- Parameters:
rowIndex- row index, starting from 0.
-
assertSelectAllChecked
public void assertSelectAllChecked()Assert that the select-all checkbox is checked. -
assertSelectAllUnchecked
public void assertSelectAllUnchecked()Assert that the select-all checkbox is unchecked. -
assertSelectAllIndeterminate
public void assertSelectAllIndeterminate()Assert that the select-all checkbox is indeterminate. -
assertDetailsOpen
public void assertDetailsOpen(int rowIndex) Assert that the details panel of the row at the given index is open.- Parameters:
rowIndex- row index, starting from 0.
-
assertDetailsClosed
public void assertDetailsClosed(int rowIndex) Assert that the details panel of the row at the given index is closed.- Parameters:
rowIndex- row index, starting from 0.
-
getById
Get aGridElementby itsid, searching the entire page.A fallback for a component without a user-visible name: prefer the label or text lookups when there is one. The id must match in full; two components with that id fail with a strict-mode error.
- Parameters:
page- the Playwright pageid- the fullid- Returns:
- the matching
GridElement
-
getById
Get aGridElementby itsid, scoped to the given locator.A fallback for a component without a user-visible name. The id must match in full; two components with that id inside the scope fail with a strict-mode error.
- Parameters:
locator- the locator whose subtree is searchedid- the fullid- Returns:
- the matching
GridElement
-
getByTestId
Get aGridElementby its test id, searching the entire page.The test id is Playwright's test id attribute,
data-testidunless reconfigured — the attribute Flow'sComponent.setTestId(String)sets. A fallback for a component without a user-visible name; it must match in full, and two components with that test id fail with a strict-mode error.- Parameters:
page- the Playwright pagetestId- the full test id- Returns:
- the matching
GridElement
-
getByTestId
Get aGridElementby its test id, scoped to the given locator.See
getByTestId(Page, String); only components inside the scope are considered.- Parameters:
locator- the locator whose subtree is searchedtestId- the full test id- Returns:
- the matching
GridElement
-
findRowIndexesWithColumnText(int, String)reads a whole column at once and no longer calls this method; overridematchesCellText(String, String)to customise matching.