]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test for #5797
authorJohn Alhroos <john.ahlroos@itmill.com>
Wed, 27 Oct 2010 07:13:31 +0000 (07:13 +0000)
committerJohn Alhroos <john.ahlroos@itmill.com>
Wed, 27 Oct 2010 07:13:31 +0000 (07:13 +0000)
svn changeset:15735/svn branch:6.4

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

diff --git a/tests/src/com/vaadin/tests/components/table/DisabledTableKeyboardNavigation.html b/tests/src/com/vaadin/tests/components/table/DisabledTableKeyboardNavigation.html
new file mode 100644 (file)
index 0000000..ce8fc3b
--- /dev/null
@@ -0,0 +1,67 @@
+<?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.DisabledTableKeyboardNavigation?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>ADisabledTableWithoutASelection</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=vaadin648runcomvaadintestscomponentstableDisabledTableKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[4]/domChild[1]/domChild[0]</td>
+       <td>56,13</td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=vaadin648runcomvaadintestscomponentstableDisabledTableKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]</td>
+       <td>down</td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=vaadin648runcomvaadintestscomponentstableDisabledTableKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]</td>
+       <td>down</td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=vaadin648runcomvaadintestscomponentstableDisabledTableKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]</td>
+       <td>down</td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=vaadin648runcomvaadintestscomponentstableDisabledTableKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]</td>
+       <td>down</td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=vaadin648runcomvaadintestscomponentstableDisabledTableKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]</td>
+       <td>down</td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=vaadin648runcomvaadintestscomponentstableDisabledTableKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]</td>
+       <td>down</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>StillADisabledTableWithoutSelection</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/src/com/vaadin/tests/components/table/DisabledTableKeyboardNavigation.java b/tests/src/com/vaadin/tests/components/table/DisabledTableKeyboardNavigation.java
new file mode 100644 (file)
index 0000000..ec888c2
--- /dev/null
@@ -0,0 +1,54 @@
+package com.vaadin.tests.components.table;
+
+import com.vaadin.data.Container;
+import com.vaadin.data.Item;
+import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Table;
+
+public class DisabledTableKeyboardNavigation extends TestBase {
+
+    @Override
+    protected void setup() {
+        final Table table = new Table("Multiselectable table");
+
+        table.setContainerDataSource(createContainer());
+        table.setImmediate(true);
+        table.setSelectable(true);
+        table.setMultiSelect(true);
+        table.setWidth("400px");
+        table.setHeight("200px");
+
+        table.setEnabled(false);
+
+        addComponent(table);
+
+    }
+
+    @Override
+    protected String getDescription() {
+        return "Once should not be able to focus or use a disabled table";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return 5797;
+    }
+
+    private Container createContainer() {
+        IndexedContainer container = new IndexedContainer();
+        container.addContainerProperty("col1", String.class, "");
+        container.addContainerProperty("col2", String.class, "");
+        container.addContainerProperty("col3", String.class, "");
+
+        for (int i = 0; i < 100; i++) {
+            Item item = container.addItem("item " + i);
+            item.getItemProperty("col1").setValue("first" + i);
+            item.getItemProperty("col2").setValue("middle" + i);
+            item.getItemProperty("col3").setValue("last" + i);
+        }
+
+        return container;
+    }
+
+}