com.vaadin.flow.component.gridpro.testbench.GridTRElement Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vaadin-grid-pro-testbench Show documentation
Show all versions of vaadin-grid-pro-testbench Show documentation
Vaadin Grid Pro Testbench API
/**
* Copyright 2000-2023 Vaadin Ltd.
*
* This program is available under Vaadin Commercial License and Service Terms.
*
* See for the full
* license.
*/
package com.vaadin.flow.component.gridpro.testbench;
import com.vaadin.testbench.TestBenchElement;
/**
* A TestBench element representing a <tr>
element in a grid.
*/
public class GridTRElement extends TestBenchElement {
/**
* Gets the cell for the given column in this row.
*
* @param column
* the column element
* @return the cell for the given column
*/
public GridTHTDElement getCell(GridProColumnElement column) {
TestBenchElement e = (TestBenchElement) executeScript(
"const grid = arguments[0];" //
+ "const columnId = arguments[1];" //
+ "return Array.from(grid.children)."
+ "filter(function(cell) { return cell._column && cell._column.__generatedTbId == columnId;})[0]",
this, column.get__generatedId());
return e == null ? null : e.wrap(GridTHTDElement.class);
}
}