summaryrefslogtreecommitdiffstats
path: root/testbench-api/src/main/java/com
diff options
context:
space:
mode:
authorAleksi Hietanen <aleksi@vaadin.com>2017-05-11 08:56:28 +0300
committerHenri Sara <henri.sara@gmail.com>2017-05-11 08:56:28 +0300
commitdc6e754f8c84c76ca086e6e862977062e5235734 (patch)
tree205147b55d3776fcca298387b8729cfc660a6232 /testbench-api/src/main/java/com
parentd25697a1230d24886b8d2219039fcb2dd38bd17c (diff)
downloadvaadin-framework-dc6e754f8c84c76ca086e6e862977062e5235734.tar.gz
vaadin-framework-dc6e754f8c84c76ca086e6e862977062e5235734.zip
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.
Diffstat (limited to 'testbench-api/src/main/java/com')
-rw-r--r--testbench-api/src/main/java/com/vaadin/testbench/elements/TreeGridElement.java18
1 files changed, 18 insertions, 0 deletions
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
@@ -119,6 +119,24 @@ public class TreeGridElement extends GridElement {
}
/**
+ * 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<String> classes = Arrays
+ .asList(expandElement.getAttribute("class").split(" "));
+ return classes.contains("expanded") || classes.contains("collapsed");
+ }
+
+ /**
* Gets the expand/collapse element for the given row.
*
* @param rowIndex