summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>2012-02-16 14:47:47 +0000
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>2012-02-16 14:47:47 +0000
commit1476a0c26b95555b25085fb0280d90aac329f07e (patch)
treed21d79b27e3e64f28a8e8449afbeca052d6bd250 /tests
parent3c2de952974b3e0e82de7951d814fd6312b434af (diff)
downloadvaadin-framework-1476a0c26b95555b25085fb0280d90aac329f07e.tar.gz
vaadin-framework-1476a0c26b95555b25085fb0280d90aac329f07e.zip
#5100 test case
svn changeset:23048/svn branch:6.8
Diffstat (limited to 'tests')
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.java
new file mode 100644
index 0000000000..43f3380e16
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.java
@@ -0,0 +1,54 @@
+package com.vaadin.tests.components.tabsheet;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.TabSheet.Tab;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class TabKeyboardNavigation extends TestBase {
+
+ int index = 1;
+ TabSheet ts = new TabSheet();
+
+ @Override
+ protected void setup() {
+ ts.setWidth("500px");
+ ts.setHeight("500px");
+ for (int i = 0; i < 4; ++i) {
+ addTab();
+ }
+ Button b = new Button("Add a tab", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ addTab();
+ }
+ });
+ addComponent(b);
+ addComponent(new TextField());
+ addComponent(ts);
+ addComponent(new TextField());
+ }
+
+ @Override
+ protected String getDescription() {
+ return "The tab bar should be focusable and arrow keys should switch tabs";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 5100;
+ }
+
+ private Tab addTab() {
+ Layout content = new VerticalLayout();
+ content.addComponent(new Label("Tab " + index));
+ content.addComponent(new TextField());
+ Tab tab = ts.addTab(content, "Tab " + index++, null);
+ tab.setClosable(true);
+ return tab;
+ }
+}