diff options
author | Artur Signell <artur.signell@itmill.com> | 2011-11-17 11:49:07 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2011-11-17 11:49:07 +0000 |
commit | 1767de7c0b83093005c36c27403dbe080b08ca44 (patch) | |
tree | 388d6a2d267755a5f5531a88f5eba61f4edb42ad /tests | |
parent | d418508bb6347c384478a25141064ed3c411ca1c (diff) | |
download | vaadin-framework-1767de7c0b83093005c36c27403dbe080b08ca44.tar.gz vaadin-framework-1767de7c0b83093005c36c27403dbe080b08ca44.zip |
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
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.htm | 48 | ||||
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java | 50 |
2 files changed, 98 insertions, 0 deletions
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 @@ +<?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.combobox.ComboBoxInPopup?restartApplication</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxInPopup::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]/domChild[1]</td> + <td>12,13</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxInPopup::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item1</td> + <td>Yes</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxInPopup::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item1</td> + <td>esc</td> +</tr> +<!--ensure the sub window is still open but the popup is not--> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxInPopup::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>A combo box</td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxInPopup::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item1</td> + <td></td> +</tr> + +</tbody></table> +</body> +</html> 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; + } + +} |