]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test for #11267 adapted from 6.8.
authorMarc Englund <marc.englund@itmill.com>
Fri, 10 May 2013 12:51:12 +0000 (12:51 +0000)
committerMarc Englund <marc@vaadin.com>
Wed, 15 May 2013 08:51:24 +0000 (08:51 +0000)
The problem is not present in 7, but you need to use a slightly different css to acieve the same result.

Change-Id: Iee6907a15fd9b0674dcb490f9110fc762c56deb6
Ticket: 11267

WebContent/VAADIN/themes/tests-tickets/styles.css
uitest/src/com/vaadin/tests/components/combobox/ComboBoxBorder.html [new file with mode: 0644]
uitest/src/com/vaadin/tests/components/combobox/ComboBoxBorder.java [new file with mode: 0644]

index c1dd89d6b877fa05f20996989f899b6f215b130b..b96fcbb23d7ee43a33ea6d630ce6fb632399fcef 100644 (file)
@@ -1,6 +1,17 @@
 @import url(../runo/legacy-styles.css);
 
-/* DO NOT ADD GENERIC RULES LIKE .v-table IN THIS FILE */
+/* DO NOT ADD GENERIC RULES LIKE .v-table IN THIS FILE                       */
+/* Instead prefix with e.g .v-app-<TestClass> or other unique selectors      */
+/*****************************************************************************/
+
+/*****************************************************************************/
+/* com.vaadin.tests.components.combobox.ComboBoxBorder                       */
+/*****************************************************************************/
+.v-slot-ComboBoxBorder .v-filterselect-error {
+       /* Ticket 11267 */
+   border: 1px solid #FF0000 ;
+   height: 25px; /* runo: 23+2, reindeer: 24+2 */
+}
 
 /*****************************************************************************/
 /* Ticket 1904                                                               */
diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxBorder.html b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxBorder.html
new file mode 100644 (file)
index 0000000..7e7bb77
--- /dev/null
@@ -0,0 +1,52 @@
+<?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>ComboBoxBorder</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">ComboBoxBorder</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td>/run/ComboBoxBorder?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runComboBoxBorder::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]#textbox</td>
+       <td>53,10</td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=runComboBoxBorder::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]#textbox</td>
+       <td>down</td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=runComboBoxBorder::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]#textbox</td>
+       <td>down</td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=runComboBoxBorder::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]#textbox</td>
+       <td>down</td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=runComboBoxBorder::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]#textbox</td>
+       <td>enter</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxBorder.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxBorder.java
new file mode 100644 (file)
index 0000000..731e231
--- /dev/null
@@ -0,0 +1,43 @@
+package com.vaadin.tests.components.combobox;
+
+import java.util.Arrays;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.server.UserError;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.ComboBox;
+
+public class ComboBoxBorder extends TestBase {
+
+    @Override
+    protected void setup() {
+        setTheme("tests-tickets");
+
+        final ComboBox cb = new ComboBox("All errors", Arrays.asList("Error",
+                "Error 2"));
+        cb.setStyleName("ComboBoxBorder");
+        cb.setImmediate(true);
+        cb.setWidth("200px"); // must have with to reproduce
+
+        cb.addListener(new ValueChangeListener() {
+            public void valueChange(ValueChangeEvent event) {
+                cb.setComponentError(new UserError("Error"));
+            }
+        });
+
+        addComponent(cb);
+
+    }
+
+    @Override
+    protected String getDescription() {
+        return "Adding a border as a result of styleName change should not break the ComboBox";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return 11267;
+    }
+
+}