]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test for #6197
authorArtur Signell <artur.signell@itmill.com>
Fri, 7 Jan 2011 15:46:07 +0000 (15:46 +0000)
committerArtur Signell <artur.signell@itmill.com>
Fri, 7 Jan 2011 15:46:07 +0000 (15:46 +0000)
svn changeset:16818/svn branch:6.5

tests/src/com/vaadin/tests/components/table/TableScrollsOnSelection.html [new file with mode: 0644]
tests/src/com/vaadin/tests/components/table/TableScrollsOnSelection.java [new file with mode: 0644]

diff --git a/tests/src/com/vaadin/tests/components/table/TableScrollsOnSelection.html b/tests/src/com/vaadin/tests/components/table/TableScrollsOnSelection.html
new file mode 100644 (file)
index 0000000..7be7e37
--- /dev/null
@@ -0,0 +1,45 @@
+<?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.table.TableScrollsOnSelection?restartApplication</td>
+       <td></td>
+</tr>
+<!--Scroll to the end of the page (show last items in Table)-->
+<tr>
+       <td>scroll</td>
+       <td>vaadin=runcomvaadintestscomponentstableTableScrollsOnSelection::</td>
+       <td>2000</td>
+</tr>
+<tr>
+       <td>pause</td>
+       <td>300</td>
+       <td></td>
+</tr>
+<!--Select the last item (79)-->
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentstableTableScrollsOnSelection::/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[79]/domChild[0]/domChild[0]</td>
+       <td>38,-892</td>
+</tr>
+<!--Ensure the page is not scrolled to the beginning-->
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>scrolled-down-and-selected-79</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/src/com/vaadin/tests/components/table/TableScrollsOnSelection.java b/tests/src/com/vaadin/tests/components/table/TableScrollsOnSelection.java
new file mode 100644 (file)
index 0000000..9d3aed0
--- /dev/null
@@ -0,0 +1,38 @@
+package com.vaadin.tests.components.table;\r
+\r
+import com.vaadin.data.Item;\r
+import com.vaadin.data.util.IndexedContainer;\r
+import com.vaadin.tests.components.TestBase;\r
+import com.vaadin.ui.Table;\r
+import com.vaadin.ui.Window;\r
+\r
+public class TableScrollsOnSelection extends TestBase {\r
+\r
+    @Override\r
+    protected void setup() {\r
+        Window mainWindow = new Window("Playground Application");\r
+        setMainWindow(mainWindow);\r
+\r
+        IndexedContainer cont = new IndexedContainer();\r
+        cont.addContainerProperty("number", String.class, null);\r
+        for (int i = 0; i < 80; i++) {\r
+            Item item = cont.addItem(i);\r
+            item.getItemProperty("number").setValue(i + "");\r
+        }\r
+        Table table = new Table();\r
+        table.setPageLength(0);\r
+        table.setContainerDataSource(cont);\r
+        table.setSelectable(true);\r
+        mainWindow.addComponent(table);\r
+    }\r
+\r
+    @Override\r
+    protected String getDescription() {\r
+        return "The scroll position should not change when an item is selected in a Table that is higher than the view.";\r
+    }\r
+\r
+    @Override\r
+    protected Integer getTicketNumber() {\r
+        return 6197;\r
+    }\r
+}\r