From 63ac2329282b227a191f418b6e11a83de57cfaa1 Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Thu, 11 Oct 2012 14:16:29 +0300 Subject: Fixed primary stylenames for combobox #9901 Change-Id: Id4f75b1630b621a0c81b405a0cab2c9262b93549 --- .../combobox/ComboboxPrimaryStyleName.html | 131 +++++++++++++++++++++ .../combobox/ComboboxPrimaryStyleNames.java | 49 ++++++++ 2 files changed, 180 insertions(+) create mode 100644 uitest/src/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleName.html create mode 100644 uitest/src/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleNames.java (limited to 'uitest/src/com/vaadin/tests') diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleName.html b/uitest/src/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleName.html new file mode 100644 index 0000000000..649dda72f8 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleName.html @@ -0,0 +1,131 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/com.vaadin.tests.components.combobox.ComboboxPrimaryStyleNames?restartApplication
assertCSSClassvaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]my-combobox
assertCSSClassvaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]/domChild[0]my-combobox-input
assertCSSClassvaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]/domChild[1]my-combobox-button
mouseClickvaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]#textbox98,8
pressSpecialKeyvaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]#textboxdown
assertCSSClass//div[@id='VAADIN_COMBOBOX_OPTIONLIST']my-combobox-suggestpopup
assertCSSClass//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[1]my-combobox-prevpage-off
assertCSSClass//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[2]my-combobox-suggestmenu
assertCSSClass//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[3]my-combobox-nextpage-off
assertCSSClass//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[4]my-combobox-status
mouseClickvaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]#textbox98,8
clickvaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]/domChild[0]
assertCSSClassvaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]my-second-combobox
assertCSSClassvaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]/domChild[0]my-second-combobox-input
assertCSSClassvaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]/domChild[1]my-second-combobox-button
mouseClickvaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]#textbox98,8
pressSpecialKeyvaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]#textboxdown
assertCSSClass//div[@id='VAADIN_COMBOBOX_OPTIONLIST']my-second-combobox-suggestpopup
assertCSSClass//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[1]my-second-combobox-prevpage-off
assertCSSClass//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[2]my-second-combobox-suggestmenu
assertCSSClass//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[3]my-second-combobox-nextpage-off
assertCSSClass//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[4]my-second-combobox-status
+ + diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleNames.java b/uitest/src/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleNames.java new file mode 100644 index 0000000000..375b417407 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleNames.java @@ -0,0 +1,49 @@ +package com.vaadin.tests.components.combobox; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.ComboBox; + +public class ComboboxPrimaryStyleNames extends TestBase { + + @Override + protected void setup() { + final ComboBox box = new ComboBox(); + box.setImmediate(true); + box.addContainerProperty("caption", String.class, ""); + box.setItemCaptionPropertyId("caption"); + box.setPrimaryStyleName("my-combobox"); + + addItem(box, "Value 1"); + addItem(box, "Value 2"); + addItem(box, "Value 3"); + addItem(box, "Value 4"); + + addComponent(box); + addComponent(new Button("Set primary style", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + box.setPrimaryStyleName("my-second-combobox"); + } + })); + + } + + @Override + protected String getDescription() { + return "Combobox should work with primary stylenames both initially and dynamically"; + } + + @Override + protected Integer getTicketNumber() { + return 9901; + } + + private void addItem(ComboBox s, String string) { + Object id = s.addItem(); + s.getItem(id).getItemProperty("caption").setValue(string); + } + +} -- cgit v1.2.3