From 1767de7c0b83093005c36c27403dbe080b08ca44 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 17 Nov 2011 11:49:07 +0000 Subject: Test for #6798. Automated test disabled (set to .htm) and should be enabled once #7948 has been fixed svn changeset:22037/svn branch:6.7 --- .../tests/components/combobox/ComboBoxInPopup.htm | 48 +++++++++++++++++++++ .../tests/components/combobox/ComboBoxInPopup.java | 50 ++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.htm create mode 100644 tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java (limited to 'tests') diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.htm b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.htm new file mode 100644 index 0000000000..f943f912e4 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.htm @@ -0,0 +1,48 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/com.vaadin.tests.components.combobox.ComboBoxInPopup?restartApplication
mouseClickvaadin=runcomvaadintestscomponentscomboboxComboBoxInPopup::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]/domChild[1]12,13
assertTextvaadin=runcomvaadintestscomponentscomboboxComboBoxInPopup::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item1Yes
pressSpecialKeyvaadin=runcomvaadintestscomponentscomboboxComboBoxInPopup::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item1esc
assertTextvaadin=runcomvaadintestscomponentscomboboxComboBoxInPopup::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]A combo box
assertElementNotPresentvaadin=runcomvaadintestscomponentscomboboxComboBoxInPopup::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item1
+ + diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java new file mode 100644 index 0000000000..8160fb576e --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java @@ -0,0 +1,50 @@ +package com.vaadin.tests.components.combobox; + +import com.vaadin.event.ShortcutAction.KeyCode; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.ComboBox; +import com.vaadin.ui.Component; +import com.vaadin.ui.Window; + +public class ComboBoxInPopup extends TestBase { + + @Override + protected void setup() { + final Window w = new Window(); + w.getContent().setSizeUndefined(); + w.addComponent(createComboBox()); + Button close = new Button("Close window", new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + w.getParent().removeWindow(w); + } + }); + close.setClickShortcut(KeyCode.ESCAPE, null); + w.addComponent(close); + + getLayout().getWindow().addWindow(w); + + } + + private Component createComboBox() { + ComboBox cb = new ComboBox("A combo box"); + + cb.addItem("Yes"); + cb.addItem("No"); + cb.addItem("Maybe"); + return cb; + } + + @Override + protected String getDescription() { + return "Escape is a shortcut for the close button. Pressing escape when the popup is open should cause only the popup to close, not the window."; + } + + @Override + protected Integer getTicketNumber() { + return 6978; + } + +} -- cgit v1.2.3