+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="" />
-<title>DisappearingComponents</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">DisappearingComponents</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.components.treetable.TreeTablePartialUpdatesPageLength0?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstreetableTreeTablePartialUpdatesPageLength0::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
- <td>10,2</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>root1-expanded-10-items</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstreetableTreeTablePartialUpdatesPageLength0::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[12]/domChild[0]/domChild[0]/domChild[0]</td>
- <td>11,3</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstreetableTreeTablePartialUpdatesPageLength0::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[11]/domChild[0]/domChild[0]/domChild[0]</td>
- <td>9,7</td>
-</tr>
-<tr>
- <td>scroll</td>
- <td>vaadin=runcomvaadintestscomponentstreetableTreeTablePartialUpdatesPageLength0::</td>
- <td>12500</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>all-expanded-bottom</td>
-</tr>
-</tbody></table>
-</body>
-</html>
import com.vaadin.data.Container.Hierarchical;
import com.vaadin.data.util.HierarchicalContainer;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.TreeTable;
-public class TreeTablePartialUpdatesPageLength0 extends TestBase {
+public class TreeTablePartialUpdatesPageLength0 extends AbstractTestUI {
@Override
- protected void setup() {
+ protected void setup(VaadinRequest request) {
setTheme("reindeer-tests");
TreeTable tt = new TreeTable();
tt.addStyleName("table-equal-rowheight");
tt.getParent().getParent().setHeight(null);
}
+ @SuppressWarnings("unchecked")
private Hierarchical makeHierarchicalContainer() {
HierarchicalContainer hc = new HierarchicalContainer();
hc.addContainerProperty("p1", String.class, "");
return hc;
}
+ @SuppressWarnings("unchecked")
private void addNodesToRoot(HierarchicalContainer hc, Object root, int count) {
for (int ix = 0; ix < count; ix++) {
Object id = hc.addItem();
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "";
}
--- /dev/null
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.treetable;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.junit.Test;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.By;
+import com.vaadin.testbench.elements.TreeTableElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+/**
+ * Tests expanding TreeTable rows when page length is zero.
+ *
+ * @author Vaadin Ltd
+ */
+public class TreeTablePartialUpdatesPageLength0Test extends MultiBrowserTest {
+
+ @Test
+ public void testExpanding() throws IOException {
+ openTestURL();
+
+ TreeTableElement treeTable = $(TreeTableElement.class).first();
+ List<WebElement> rows = treeTable.findElement(
+ By.className("v-table-body")).findElements(By.tagName("tr"));
+ assertEquals("unexpected row count", 4, rows.size());
+ assertEquals("unexpected contents", "root1", treeTable.getCell(0, 0)
+ .getText());
+ assertEquals("unexpected contents", "root2", treeTable.getCell(1, 0)
+ .getText());
+ assertEquals("unexpected contents", "root3", treeTable.getCell(2, 0)
+ .getText());
+ assertEquals("unexpected contents", "END", treeTable.getCell(3, 0)
+ .getText());
+
+ // expand first row, should have 10 children
+ treeTable.getCell(0, 0)
+ .findElement(By.className("v-treetable-treespacer")).click();
+
+ treeTable = $(TreeTableElement.class).first();
+ rows = treeTable.findElement(By.className("v-table-body"))
+ .findElements(By.tagName("tr"));
+ assertEquals("unexpected row count", 14, rows.size());
+
+ // expand root3, should have 200 children
+ assertEquals("unexpected contents", "root3", treeTable.getCell(12, 0)
+ .getText());
+ treeTable.getCell(12, 0)
+ .findElement(By.className("v-treetable-treespacer")).click();
+
+ // expand root2, should have 200 children
+ assertEquals("unexpected contents", "root2", treeTable.getCell(11, 0)
+ .getText());
+ treeTable.getCell(11, 0)
+ .findElement(By.className("v-treetable-treespacer")).click();
+
+ treeTable = $(TreeTableElement.class).first();
+ rows = treeTable.findElement(By.className("v-table-body"))
+ .findElements(By.tagName("tr"));
+ assertEquals("unexpected row count", 414, rows.size());
+
+ // scroll all the way to the bottom
+ WebElement ui = findElement(By.className("v-ui"));
+ testBenchElement(ui).scroll(12500);
+
+ compareScreen("bottom");
+ }
+}