diff options
author | Artur Signell <artur.signell@itmill.com> | 2011-04-11 09:23:01 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2011-04-11 09:23:01 +0000 |
commit | d45dbbd903378f649f84f4a5f67ef584a465e161 (patch) | |
tree | e9cb245e8c3494be89dcc3340ed79105f99e81d3 /tests/src | |
parent | 55f24e32248ebceb3d5686a3f0db22694020ee1c (diff) | |
download | vaadin-framework-d45dbbd903378f649f84f4a5f67ef584a465e161.tar.gz vaadin-framework-d45dbbd903378f649f84f4a5f67ef584a465e161.zip |
Test for #6774
svn changeset:18195/svn branch:6.5
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/com/vaadin/tests/components/table/TableScrollOnFocus.html | 47 | ||||
-rw-r--r-- | tests/src/com/vaadin/tests/components/table/TableScrollOnFocus.java | 49 |
2 files changed, 96 insertions, 0 deletions
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 index 0000000000..1a91211040 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/table/TableScrollOnFocus.html @@ -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 index 0000000000..05e101a5f9 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/table/TableScrollOnFocus.java @@ -0,0 +1,49 @@ +package com.vaadin.tests.components.table;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Table;
+
+public class TableScrollOnFocus extends TestBase {
+ @Override
+ protected void setup() {
+ final Table table = new Table();
+ final CheckBox chkSelectable = new CheckBox("selectable");
+
+ chkSelectable.setImmediate(true);
+ chkSelectable.addListener(new ValueChangeListener() {
+ public void valueChange(ValueChangeEvent event) {
+ table.setSelectable(chkSelectable.booleanValue());
+ }
+ });
+
+ table.addContainerProperty("row #", String.class, "-");
+ table.setColumnWidth("row #", 150);
+ for (int i = 1; i < 200; i++) {
+ table.addItem(new String[] { "" + i }, null);
+ }
+ table.setSortDisabled(true);
+
+ chkSelectable.setValue(true);
+
+ addComponent(chkSelectable);
+ addComponent(table);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "The table scrolls up 2 pages after loosing and regaining the focus!</b><p>"
+ + "Drag scrollbar to top then to the bottom of the table.<br>"
+ + "Click somewhere beside the table to take away the focus,<br>"
+ + "then click back on the table (header or scrollbar) to give back the focus<br>"
+ + "(Pressing Tab and Shift-Tab does the same job).<p>"
+ + "If the table is set to non-selectable-mode, no self-scrolling occurs.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 6774;
+ }
+}
\ No newline at end of file |