summaryrefslogtreecommitdiffstats
path: root/tests/testbench
diff options
context:
space:
mode:
authorHenri Sara <henri.sara@itmill.com>2011-11-21 13:45:31 +0000
committerHenri Sara <henri.sara@itmill.com>2011-11-21 13:45:31 +0000
commit0e7673b718c4e76617febdf34e4afda3b80c3fa4 (patch)
tree03637fd196c857a3bd8566a561187550f2a63d1a /tests/testbench
parentf827c39e1d353ade1aa007d50623a3d49f688df9 (diff)
downloadvaadin-framework-0e7673b718c4e76617febdf34e4afda3b80c3fa4.tar.gz
vaadin-framework-0e7673b718c4e76617febdf34e4afda3b80c3fa4.zip
#7908 TreeTable should resize on container change when page length is zero, related test
svn changeset:22082/svn branch:6.7
Diffstat (limited to 'tests/testbench')
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.html67
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java17
2 files changed, 84 insertions, 0 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.html b/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.html
new file mode 100644
index 0000000000..8391ca186d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.html
@@ -0,0 +1,67 @@
+<?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>ChangeDataSourcePageLengthZero</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">ChangeDataSourcePageLengthZero</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.treetable.ChangeDataSourcePageLengthZero?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>initial</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentstreetableChangeDataSourcePageLengthZero::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>smallcontainer</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstreetableChangeDataSourcePageLengthZero::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[3]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>12,8</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>expanded</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentstreetableChangeDataSourcePageLengthZero::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>addeditem</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentstreetableChangeDataSourcePageLengthZero::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>bigcontainer</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java b/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java
index 701c7a6a36..3d01883deb 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java
@@ -31,8 +31,25 @@ public class ChangeDataSourcePageLengthZero extends TestBase {
setupContainer(tt, 10);
}
});
+ Button addButton = new Button("Add item");
+ addButton.addListener(new Button.ClickListener() {
+ private int i = 1;
+
+ public void buttonClick(ClickEvent event) {
+ HierarchicalContainer container = (HierarchicalContainer) tt
+ .getContainerDataSource();
+ Object itemId = container.addItem();
+ container.getContainerProperty(itemId, "i").setValue(i++);
+ container.getContainerProperty(itemId, "link").setValue(
+ new Link(String.valueOf(i + 1), new ExternalResource(
+ "http://www.google.fi")));
+ container.setChildrenAllowed(itemId, false);
+ container.setParent(itemId, null);
+ }
+ });
addComponent(page1);
addComponent(page2);
+ addComponent(addButton);
}
private static void setupContainer(TreeTable tt, int num) {