From cfbfafbc04b12502a9538779063e0388680bd04a Mon Sep 17 00:00:00 2001 From: John Alhroos Date: Mon, 28 Jun 2010 11:21:02 +0000 Subject: [PATCH] Test for #5180 svn changeset:13938/svn branch:6.4 --- .../MenuBarRootItemSelectWithKeyboard.html | 52 +++++++++++++++++++ .../MenuBarRootItemSelectWithKeyboard.java | 38 ++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 tests/src/com/vaadin/tests/components/menubar/MenuBarRootItemSelectWithKeyboard.html create mode 100644 tests/src/com/vaadin/tests/components/menubar/MenuBarRootItemSelectWithKeyboard.java diff --git a/tests/src/com/vaadin/tests/components/menubar/MenuBarRootItemSelectWithKeyboard.html b/tests/src/com/vaadin/tests/components/menubar/MenuBarRootItemSelectWithKeyboard.html new file mode 100644 index 0000000000..a53757a969 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/menubar/MenuBarRootItemSelectWithKeyboard.html @@ -0,0 +1,52 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/com.vaadin.tests.components.menubar.MenuBarRootItemSelectWithKeyboard?restartApplication
mouseClickvaadin=runcomvaadintestscomponentsmenubarMenuBarRootItemSelectWithKeyboard::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VMenuBar[0]#item022,9
pressSpecialKeyvaadin=runcomvaadintestscomponentsmenubarMenuBarRootItemSelectWithKeyboard::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VMenuBar[0]down
pressSpecialKeyvaadin=runcomvaadintestscomponentsmenubarMenuBarRootItemSelectWithKeyboard::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VMenuBar[0]up
pressSpecialKeyvaadin=runcomvaadintestscomponentsmenubarMenuBarRootItemSelectWithKeyboard::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VMenuBar[0]right
pressSpecialKeyvaadin=runcomvaadintestscomponentsmenubarMenuBarRootItemSelectWithKeyboard::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VMenuBar[0]enter
screenCaptureNoItemShouldBeSelected
+ + diff --git a/tests/src/com/vaadin/tests/components/menubar/MenuBarRootItemSelectWithKeyboard.java b/tests/src/com/vaadin/tests/components/menubar/MenuBarRootItemSelectWithKeyboard.java new file mode 100644 index 0000000000..f162386336 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/menubar/MenuBarRootItemSelectWithKeyboard.java @@ -0,0 +1,38 @@ +package com.vaadin.tests.components.menubar; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.MenuBar; +import com.vaadin.ui.MenuBar.Command; +import com.vaadin.ui.MenuBar.MenuItem; + +public class MenuBarRootItemSelectWithKeyboard extends TestBase { + + @Override + protected void setup() { + Command c = new Command() { + public void menuSelected(MenuItem selectedItem) { + getMainWindow().showNotification(selectedItem.getText()); + + } + }; + + MenuBar root = new MenuBar(); + + MenuItem submenu = root.addItem("Hello", null); + submenu.addItem("World", c); + + root.addItem("World", c); + addComponent(root); + } + + @Override + protected String getDescription() { + return "When selecting an root menu item from the menubar with the keyboard (enter) the selection should be removed"; + } + + @Override + protected Integer getTicketNumber() { + return 5180; + } + +} -- 2.39.5