aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2010-08-16 11:58:07 +0000
committerArtur Signell <artur.signell@itmill.com>2010-08-16 11:58:07 +0000
commit50015371f8abb56a01473b8fab63091fd4257879 (patch)
treed6ac8641e027c771c2e3af9c28062091df8c252d
parent789c80e2537d800f029734184975c13464f116a8 (diff)
downloadvaadin-framework-50015371f8abb56a01473b8fab63091fd4257879.tar.gz
vaadin-framework-50015371f8abb56a01473b8fab63091fd4257879.zip
Test case for #5400
svn changeset:14499/svn branch:6.4
-rw-r--r--tests/src/com/vaadin/tests/components/tree/TreeScrolling.html37
-rw-r--r--tests/src/com/vaadin/tests/components/tree/TreeScrolling.java53
2 files changed, 90 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/tree/TreeScrolling.html b/tests/src/com/vaadin/tests/components/tree/TreeScrolling.html
new file mode 100644
index 0000000000..bcf3a20b84
--- /dev/null
+++ b/tests/src/com/vaadin/tests/components/tree/TreeScrolling.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.tree.TreeScrolling?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>initial</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstreeTreeScrolling::/VVerticalLayout[0]/ChildComponentContainer[2]/VTree[0]/domChild[0]/domChild[0]/domChild[1]/domChild[14]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>67,8</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>selected-0-14</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/src/com/vaadin/tests/components/tree/TreeScrolling.java b/tests/src/com/vaadin/tests/components/tree/TreeScrolling.java
new file mode 100644
index 0000000000..4406f1c68d
--- /dev/null
+++ b/tests/src/com/vaadin/tests/components/tree/TreeScrolling.java
@@ -0,0 +1,53 @@
+package com.vaadin.tests.components.tree;
+
+import com.vaadin.data.Item;
+import com.vaadin.tests.components.AbstractTestCase;
+import com.vaadin.ui.RichTextArea;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.Tree;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+
+public class TreeScrolling extends AbstractTestCase {
+
+ @Override
+ public void init() {
+ VerticalLayout layout = new VerticalLayout();
+ layout.setSizeUndefined();
+ Window w = new Window("", layout);
+ setMainWindow(w);
+
+ TextField filler1 = new TextField();
+ RichTextArea filler2 = new RichTextArea();
+ Tree tree = new Tree();
+ for (int i = 0; i < 20; i++) {
+ String parentId = "Item " + i;
+ Item parentItem = tree.addItem(parentId);
+ for (int j = 0; j < 20; j++) {
+ String subId = "Item " + i + " - " + j;
+ Item subItem = tree.addItem(subId);
+ tree.setParent(subId, parentId);
+ }
+
+ }
+
+ for (Object id : tree.rootItemIds()) {
+ tree.expandItemsRecursively(id);
+ }
+
+ layout.addComponent(filler1);
+ layout.addComponent(filler2);
+ layout.addComponent(tree);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Tests what happens when a tree is partly out of view when an item is selected";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 5400;
+ }
+
+}