summaryrefslogtreecommitdiffstats
path: root/uitest/src/com
diff options
context:
space:
mode:
authorMarc Englund <marc@vaadin.com>2012-10-15 12:48:56 +0000
committerVaadin Code Review <review@vaadin.com>2012-10-15 12:48:56 +0000
commit6075149eb323d9d63414e917b5b9d43519682217 (patch)
tree7724e4c6cdd9b4ec61a5ae5f904a0afb1d002c6b /uitest/src/com
parent63dc0d1c4387036f52c6a8875d2bacd619b422dc (diff)
parent79a6f890e794df686fc28d2dea831515b23953d8 (diff)
downloadvaadin-framework-6075149eb323d9d63414e917b5b9d43519682217.tar.gz
vaadin-framework-6075149eb323d9d63414e917b5b9d43519682217.zip
Merge "Merged AbstractSelect now listens to changes in icon property (#9663)"
Diffstat (limited to 'uitest/src/com')
-rw-r--r--uitest/src/com/vaadin/tests/components/tree/TreeIconUpdate.html42
-rw-r--r--uitest/src/com/vaadin/tests/components/tree/TreeIconUpdate.java71
2 files changed, 113 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/tree/TreeIconUpdate.html b/uitest/src/com/vaadin/tests/components/tree/TreeIconUpdate.html
new file mode 100644
index 0000000000..d16d8fd79d
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/tree/TreeIconUpdate.html
@@ -0,0 +1,42 @@
+<?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="http://localhost:9999/" />
+<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.tree.TreeIconUpdate?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentstreeTreeIconUpdate::/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>foo-with-different-icon</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentstreeTreeIconUpdate::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstreeTreeIconUpdate::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#n[0]</td>
+ <td>foo</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/components/tree/TreeIconUpdate.java b/uitest/src/com/vaadin/tests/components/tree/TreeIconUpdate.java
new file mode 100644
index 0000000000..8e0eac801d
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/tree/TreeIconUpdate.java
@@ -0,0 +1,71 @@
+package com.vaadin.tests.components.tree;
+
+import com.vaadin.data.Item;
+import com.vaadin.data.util.HierarchicalContainer;
+import com.vaadin.server.Resource;
+import com.vaadin.server.ThemeResource;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Tree;
+
+public class TreeIconUpdate extends TestBase {
+
+ private static final Resource ICON1 = new ThemeResource(
+ "../runo/icons/16/folder.png");
+ private static final Resource ICON2 = new ThemeResource(
+ "../runo/icons/16/ok.png");
+
+ @Override
+ protected void setup() {
+ HierarchicalContainer container = new HierarchicalContainer();
+ container.addContainerProperty("name", String.class, null);
+ container.addContainerProperty("icon", Resource.class, null);
+ final Tree tree = new Tree();
+ tree.setContainerDataSource(container);
+ tree.setItemIconPropertyId("icon");
+ tree.setItemCaptionPropertyId("name");
+
+ for (int i = 0; i < 20; i++) {
+ Item bar = container.addItem("bar" + i);
+ bar.getItemProperty("name").setValue("Bar" + i);
+ bar.getItemProperty("icon").setValue(ICON1);
+
+ if (i > 3) {
+ container.setParent("bar" + i, "bar" + (i - 1));
+ }
+ }
+
+ addComponent(tree);
+
+ Button button = new Button("Change icon", new ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ tree.getItem("bar0").getItemProperty("icon").setValue(ICON2);
+ }
+ });
+
+ addComponent(button);
+ button = new Button("Change caption", new ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ tree.getItem("bar0").getItemProperty("name").setValue("foo");
+ }
+ });
+
+ addComponent(button);
+
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Click the button to change the icon. The tree should be updated";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 9663;
+ }
+
+}