diff options
-rw-r--r-- | tests/src/com/vaadin/tests/components/caption/EmptyCaptions.html | 32 | ||||
-rw-r--r-- | tests/src/com/vaadin/tests/components/caption/EmptyCaptions.java | 56 |
2 files changed, 88 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/caption/EmptyCaptions.html b/tests/src/com/vaadin/tests/components/caption/EmptyCaptions.html new file mode 100644 index 0000000000..dc98bbacbb --- /dev/null +++ b/tests/src/com/vaadin/tests/components/caption/EmptyCaptions.html @@ -0,0 +1,32 @@ +<?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>EmptyCaptions</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">EmptyCaptions</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.caption.EmptyCaptions</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>initial</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/src/com/vaadin/tests/components/caption/EmptyCaptions.java b/tests/src/com/vaadin/tests/components/caption/EmptyCaptions.java new file mode 100644 index 0000000000..86f0bd6b9d --- /dev/null +++ b/tests/src/com/vaadin/tests/components/caption/EmptyCaptions.java @@ -0,0 +1,56 @@ +package com.vaadin.tests.components.caption;
+
+import com.vaadin.terminal.UserError;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.TextField;
+
+public class EmptyCaptions extends TestBase {
+
+ @Override
+ protected void setup() {
+ TextField tf;
+
+ tf = new TextField(null, "Null caption");
+ addComponent(tf);
+
+ tf = new TextField("", "Empty caption");
+ addComponent(tf);
+
+ tf = new TextField(" ", "Space as caption");
+ addComponent(tf);
+
+ tf = new TextField(null, "Null caption, required");
+ tf.setRequired(true);
+ addComponent(tf);
+ tf = new TextField("", "Empty caption, required");
+ tf.setRequired(true);
+ addComponent(tf);
+ tf = new TextField(" ", "Space as caption, required");
+ tf.setRequired(true);
+ addComponent(tf);
+
+ tf = new TextField(null, "Null caption, error");
+ tf.setComponentError(new UserError("error"));
+ addComponent(tf);
+
+ tf = new TextField("", "Empty caption, error");
+ tf.setComponentError(new UserError("error"));
+ addComponent(tf);
+
+ tf = new TextField(" ", "Space as caption, error");
+ tf.setComponentError(new UserError("error"));
+ addComponent(tf);
+
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Null caption should never use space while a non-null caption always should use space.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 3846;
+ }
+
+}
|