com.vaadin.flow.component.gridpro.testbench.GridTRElement Maven / Gradle / Ivy
package com.vaadin.flow.component.gridpro.testbench;
/*
* #%L
* Vaadin GridPro Testbench API
* %%
* Copyright (C) 2018 Vaadin Ltd
* %%
* This program is available under Commercial Vaadin Add-On License 3.0
* (CVALv3).
*
* See the file license.html distributed with this software for more
* information about licensing.
*
* You should have received a copy of the CVALv3 along with this program.
* If not, see .
* #L%
*/
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);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy