summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2012-10-11 14:16:29 +0300
committerJohn Ahlroos <john@vaadin.com>2012-10-11 14:53:02 +0300
commit63ac2329282b227a191f418b6e11a83de57cfaa1 (patch)
treef580f423ee8652781d397ab7523bc4453dcd39f6 /uitest/src/com/vaadin/tests
parentdec9f91a708d5b7b4ec1d6a2faaddf2b64827d3e (diff)
downloadvaadin-framework-63ac2329282b227a191f418b6e11a83de57cfaa1.tar.gz
vaadin-framework-63ac2329282b227a191f418b6e11a83de57cfaa1.zip
Fixed primary stylenames for combobox #9901
Change-Id: Id4f75b1630b621a0c81b405a0cab2c9262b93549
Diffstat (limited to 'uitest/src/com/vaadin/tests')
-rw-r--r--uitest/src/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleName.html131
-rw-r--r--uitest/src/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleNames.java49
2 files changed, 180 insertions, 0 deletions
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 @@
+<?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="http://localhost:8888/" />
+<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.ComboboxPrimaryStyleNames?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]</td>
+ <td>my-combobox</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]/domChild[0]</td>
+ <td>my-combobox-input</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]/domChild[1]</td>
+ <td>my-combobox-button</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]#textbox</td>
+ <td>98,8</td>
+</tr>
+<tr>
+ <td>pressSpecialKey</td>
+ <td>vaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]#textbox</td>
+ <td>down</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>//div[@id='VAADIN_COMBOBOX_OPTIONLIST']</td>
+ <td>my-combobox-suggestpopup</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[1]</td>
+ <td>my-combobox-prevpage-off</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[2]</td>
+ <td>my-combobox-suggestmenu</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[3]</td>
+ <td>my-combobox-nextpage-off</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[4]</td>
+ <td>my-combobox-status</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]#textbox</td>
+ <td>98,8</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]</td>
+ <td>my-second-combobox</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]/domChild[0]</td>
+ <td>my-second-combobox-input</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]/domChild[1]</td>
+ <td>my-second-combobox-button</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]#textbox</td>
+ <td>98,8</td>
+</tr>
+<tr>
+ <td>pressSpecialKey</td>
+ <td>vaadin=runcomvaadintestscomponentscomboboxComboboxPrimaryStyleNames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VFilterSelect[0]#textbox</td>
+ <td>down</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>//div[@id='VAADIN_COMBOBOX_OPTIONLIST']</td>
+ <td>my-second-combobox-suggestpopup</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[1]</td>
+ <td>my-second-combobox-prevpage-off</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[2]</td>
+ <td>my-second-combobox-suggestmenu</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[3]</td>
+ <td>my-second-combobox-nextpage-off</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[4]</td>
+ <td>my-second-combobox-status</td>
+</tr>
+</tbody></table>
+</body>
+</html>
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);
+ }
+
+}