From b4861eda6bbda053277e3fb6858b8a94e8c3243b Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Wed, 24 Aug 2016 14:05:02 +0300 Subject: Implement DetailsGenerators for Grid Change-Id: I09057b990f10bde6cf72a16677e58cb2bc9a7029 --- .../testbench/customelements/GridElement.java | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 uitest-common/src/main/java/com/vaadin/testbench/customelements/GridElement.java (limited to 'uitest-common') diff --git a/uitest-common/src/main/java/com/vaadin/testbench/customelements/GridElement.java b/uitest-common/src/main/java/com/vaadin/testbench/customelements/GridElement.java new file mode 100644 index 0000000000..dd1e2ca4e3 --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/testbench/customelements/GridElement.java @@ -0,0 +1,31 @@ +package com.vaadin.testbench.customelements; + +import org.openqa.selenium.NoSuchElementException; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.TestBenchElement; +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.ui.Grid") +public class GridElement extends com.vaadin.testbench.elements.GridElement { + + /** + * Gets the element that contains the details of a row. + * + * @since + * @param rowIndex + * the index of the row for the details + * @return the element that contains the details of a row. null + * if no widget is defined for the detials row + * @throws NoSuchElementException + * if the given details row is currently not open + */ + public TestBenchElement getDetails(int rowIndex) + throws NoSuchElementException { + return getSubPart("#details[" + rowIndex + "]"); + } + + private TestBenchElement getSubPart(String subPartSelector) { + return (TestBenchElement) findElement(By.vaadin(subPartSelector)); + } +} -- cgit v1.2.3