From 0cf5210bb207b6747f94aced9d30a0754b0e051a Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 24 Jun 2010 09:07:12 +0000 Subject: [PATCH] Updated test case to catch all #2974 problems svn changeset:13898/svn branch:6.4 --- .../components/combobox/ComboBoxItemIcon.html | 25 ++++++++-- .../components/combobox/ComboBoxItemIcon.java | 46 +++++++++++++------ 2 files changed, 55 insertions(+), 16 deletions(-) diff --git a/tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.html b/tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.html index 447000d6d7..6e6e87bc7e 100644 --- a/tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.html +++ b/tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.html @@ -13,7 +13,7 @@ open - /run/com.vaadin.tests.components.combobox.ComboBoxItemIcon + /run/com.vaadin.tests.components.combobox.ComboBoxItemIcon?restartApplication @@ -34,7 +34,7 @@ screenCapture - + first-combobox-open click @@ -49,9 +49,28 @@ screenCapture + fi-hu-selected + + + mouseClick + vaadin=runcomvaadintestscomponentscomboboxComboBoxItemIcon::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VFilterSelect[0]/domChild[2] + 12,17 + + + screenCapture + + second-combobox-open + + + mouseClick + vaadin=runcomvaadintestscomponentscomboboxComboBoxItemIcon::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item2 + 32,10 + + + screenCapture + fi-au-selected - diff --git a/tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java b/tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java index 4800316a5a..69c19946a2 100644 --- a/tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java +++ b/tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java @@ -15,23 +15,43 @@ public class ComboBoxItemIcon extends TestBase { @Override protected String getDescription() { - return "The items in the ComboBox should have icons - also when selected."; + return "All items in the ComboBoxes should have icons."; } @Override protected void setup() { - ComboBox cb = new ComboBox(); - cb.addContainerProperty("icon", Resource.class, null); - cb.setItemIconPropertyId("icon"); - getLayout().addComponent(cb); - - Item item = cb.addItem("FI"); - item.getItemProperty("icon").setValue( - new ThemeResource("../sampler/flags/fi.gif")); - item = cb.addItem("SE"); - item.getItemProperty("icon").setValue( - new ThemeResource("../sampler/flags/se.gif")); - + { + ComboBox cb = new ComboBox(); + cb.addContainerProperty("icon", Resource.class, null); + cb.setItemIconPropertyId("icon"); + + Item item = cb.addItem("FI"); + item.getItemProperty("icon").setValue( + new ThemeResource("../sampler/flags/fi.gif")); + item = cb.addItem("SE"); + item.getItemProperty("icon").setValue( + new ThemeResource("../sampler/flags/se.gif")); + + addComponent(cb); + } + { + ComboBox cb = new ComboBox(); + cb.addContainerProperty("icon", Resource.class, null); + cb.setItemIconPropertyId("icon"); + + Item item = cb.addItem("Finland"); + item.getItemProperty("icon").setValue( + new ThemeResource("../sampler/flags/fi.gif")); + item = cb.addItem("Australia"); + item.getItemProperty("icon").setValue( + new ThemeResource("../sampler/flags/au.gif")); + item = cb.addItem("Hungary"); + item.getItemProperty("icon").setValue( + new ThemeResource("../sampler/flags/hu.gif")); + + cb.setValue("Hungary"); + addComponent(cb); + } } } -- 2.39.5