From dc6e754f8c84c76ca086e6e862977062e5235734 Mon Sep 17 00:00:00 2001 From: Aleksi Hietanen Date: Thu, 11 May 2017 08:56:28 +0300 Subject: Reset HierarchicalDataCommunicator on changes (#9275) Reset HDC when encountering unexpected changes in the data. Additionally this patch fixes an issue with client and server caches getting out of sync during resets. --- .../com/vaadin/testbench/elements/TreeGridElement.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'testbench-api/src/main/java/com/vaadin') diff --git a/testbench-api/src/main/java/com/vaadin/testbench/elements/TreeGridElement.java b/testbench-api/src/main/java/com/vaadin/testbench/elements/TreeGridElement.java index 13dfbbf565..3eb8b30b5e 100644 --- a/testbench-api/src/main/java/com/vaadin/testbench/elements/TreeGridElement.java +++ b/testbench-api/src/main/java/com/vaadin/testbench/elements/TreeGridElement.java @@ -118,6 +118,24 @@ public class TreeGridElement extends GridElement { return !isRowExpanded(rowIndex, hierarchyColumnIndex); } + /** + * Check whether the given indices correspond to a cell that contains a + * visible hierarchy toggle element. + * + * @param rowIndex + * 0-based row index + * @param hierarchyColumnIndex + * 0-based index of the hierarchy column + * @return {@code true} if this cell has the expand toggle visible + */ + public boolean hasExpandToggle(int rowIndex, int hierarchyColumnIndex) { + WebElement expandElement = getExpandElement(rowIndex, + hierarchyColumnIndex); + List classes = Arrays + .asList(expandElement.getAttribute("class").split(" ")); + return classes.contains("expanded") || classes.contains("collapsed"); + } + /** * Gets the expand/collapse element for the given row. * -- cgit v1.2.3