diff options
Diffstat (limited to 'tests/testbench/com/vaadin')
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) {
|