diff options
author | Leif Åstrand <leif@vaadin.com> | 2011-12-05 15:37:05 +0000 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2011-12-05 15:37:05 +0000 |
commit | 671292a04b0a9b52299f3e289a975d7a8212b5e6 (patch) | |
tree | 80dfc5844758d6d07d3756362d18fd54c875a2c3 /tests/testbench | |
parent | 5a55a5b71943a7095679d9c627023176c0415e06 (diff) | |
download | vaadin-framework-671292a04b0a9b52299f3e289a975d7a8212b5e6.tar.gz vaadin-framework-671292a04b0a9b52299f3e289a975d7a8212b5e6.zip |
Test case for #8041
svn changeset:22237/svn branch:6.7
Diffstat (limited to 'tests/testbench')
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/treetable/AddNodesOnExpand.html | 37 | ||||
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/treetable/AddNodesOnExpand.java | 55 |
2 files changed, 92 insertions, 0 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/AddNodesOnExpand.html b/tests/testbench/com/vaadin/tests/components/treetable/AddNodesOnExpand.html new file mode 100644 index 0000000000..efcbded1d5 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/treetable/AddNodesOnExpand.html @@ -0,0 +1,37 @@ +<?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>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.treetable.AddNodesOnExpand?restartApplication</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreetableAddNodesOnExpand::/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>11,7</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreetableAddNodesOnExpand::/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>11,7</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>collapsed</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/treetable/AddNodesOnExpand.java b/tests/testbench/com/vaadin/tests/components/treetable/AddNodesOnExpand.java new file mode 100644 index 0000000000..5bf0370bab --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/treetable/AddNodesOnExpand.java @@ -0,0 +1,55 @@ +package com.vaadin.tests.components.treetable; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Tree; +import com.vaadin.ui.Tree.CollapseEvent; +import com.vaadin.ui.Tree.ExpandEvent; +import com.vaadin.ui.TreeTable; + +public class AddNodesOnExpand extends TestBase { + private TreeTable treetable; + + @Override + public void setup() { + treetable = new TreeTable(); + treetable.setImmediate(true); + treetable.setWidth("100%"); + treetable.setHeight(null); + treetable.setPageLength(0); + treetable.addContainerProperty("foo", String.class, ""); + treetable.addListener(new Tree.ExpandListener() { + public void nodeExpand(ExpandEvent event) { + Object openedItemId = event.getItemId(); + if (!treetable.hasChildren(openedItemId)) { + for (int j = 0; j < 3; j++) { + treetable.addItem(openedItemId + "-" + j); + treetable.setParent(openedItemId + "-" + j, + openedItemId); + } + } + } + }); + treetable.addListener(new Tree.CollapseListener() { + public void nodeCollapse(CollapseEvent event) { + /* Uncomment this to "fix" the TreeTable */ + // orgTree.refreshRowCache(); + } + }); + + for (int i = 0; i < 3; i++) { + treetable.addItem(Integer.valueOf(i)); + } + + addComponent(treetable); + } + + @Override + protected String getDescription() { + return "Expanding a node and then collapsing it should not cause scrollbars to appear"; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(8041); + } +}
\ No newline at end of file |