]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test for #6774
authorArtur Signell <artur.signell@itmill.com>
Mon, 11 Apr 2011 09:23:01 +0000 (09:23 +0000)
committerArtur Signell <artur.signell@itmill.com>
Mon, 11 Apr 2011 09:23:01 +0000 (09:23 +0000)
svn changeset:18195/svn branch:6.5

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

diff --git a/tests/src/com/vaadin/tests/components/table/TableScrollOnFocus.html b/tests/src/com/vaadin/tests/components/table/TableScrollOnFocus.html
new file mode 100644 (file)
index 0000000..1a91211
--- /dev/null
@@ -0,0 +1,47 @@
+<?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://arturwin.office.itmill.com:8888/" />
+<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.TableScrollOnFocus?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>scroll</td>
+       <td>vaadin=runcomvaadintestscomponentstableTableScrollOnFocus::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]</td>
+       <td>3864</td>
+</tr>
+<tr>
+       <td>pause</td>
+       <td>300</td>
+       <td></td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentstableTableScrollOnFocus::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
+       <td>391,141</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentstableTableScrollOnFocus::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]</td>
+       <td>3234</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>visible-185-199</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/src/com/vaadin/tests/components/table/TableScrollOnFocus.java b/tests/src/com/vaadin/tests/components/table/TableScrollOnFocus.java
new file mode 100644 (file)
index 0000000..05e101a
--- /dev/null
@@ -0,0 +1,49 @@
+package com.vaadin.tests.components.table;\r
+\r
+import com.vaadin.data.Property.ValueChangeEvent;\r
+import com.vaadin.data.Property.ValueChangeListener;\r
+import com.vaadin.tests.components.TestBase;\r
+import com.vaadin.ui.CheckBox;\r
+import com.vaadin.ui.Table;\r
+\r
+public class TableScrollOnFocus extends TestBase {\r
+    @Override\r
+    protected void setup() {\r
+        final Table table = new Table();\r
+        final CheckBox chkSelectable = new CheckBox("selectable");\r
+\r
+        chkSelectable.setImmediate(true);\r
+        chkSelectable.addListener(new ValueChangeListener() {\r
+            public void valueChange(ValueChangeEvent event) {\r
+                table.setSelectable(chkSelectable.booleanValue());\r
+            }\r
+        });\r
+\r
+        table.addContainerProperty("row #", String.class, "-");\r
+        table.setColumnWidth("row #", 150);\r
+        for (int i = 1; i < 200; i++) {\r
+            table.addItem(new String[] { "" + i }, null);\r
+        }\r
+        table.setSortDisabled(true);\r
+\r
+        chkSelectable.setValue(true);\r
+\r
+        addComponent(chkSelectable);\r
+        addComponent(table);\r
+    }\r
+\r
+    @Override\r
+    protected String getDescription() {\r
+        return "The table scrolls up 2 pages after loosing and regaining the focus!</b><p>"\r
+                + "Drag scrollbar to top then to the bottom of the table.<br>"\r
+                + "Click somewhere beside the table to take away the focus,<br>"\r
+                + "then click back on the table (header or scrollbar) to give back the focus<br>"\r
+                + "(Pressing Tab and Shift-Tab does the same job).<p>"\r
+                + "If the table is set to non-selectable-mode, no self-scrolling occurs.";\r
+    }\r
+\r
+    @Override\r
+    protected Integer getTicketNumber() {\r
+        return 6774;\r
+    }\r
+}
\ No newline at end of file