aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/src/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.html42
-rw-r--r--tests/src/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java57
2 files changed, 99 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.html b/tests/src/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.html
new file mode 100644
index 0000000000..ecac497a1b
--- /dev/null
+++ b/tests/src/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.html
@@ -0,0 +1,42 @@
+<?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.formlayout.FormLayoutReplaceComponent?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsformlayoutFormLayoutReplaceComponent::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCheckBox[0]/domChild[0]</td>
+ <td>6,6</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>textarea-visible</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsformlayoutFormLayoutReplaceComponent::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCheckBox[0]/domChild[0]</td>
+ <td>5,8</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>textarea-hidden</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/src/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java b/tests/src/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java
new file mode 100644
index 0000000000..e42d64201e
--- /dev/null
+++ b/tests/src/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java
@@ -0,0 +1,57 @@
+package com.vaadin.tests.components.formlayout;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.FormLayout;
+import com.vaadin.ui.TextField;
+
+public class FormLayoutReplaceComponent extends TestBase {
+
+ @Override
+ protected void setup() {
+ addComponent(new FL());
+
+ }
+
+ public class FL extends FormLayout implements ClickListener {
+
+ private TextField messages;
+ private CheckBox control;
+
+ @SuppressWarnings("deprecation")
+ public FL() {
+ setCaption("Test");
+ control = new CheckBox("Messages On/Off");
+ control.addListener(this);
+ control.setImmediate(true);
+ addComponent(control);
+
+ // The bug is in replaceComponent, triggered when VTextField is
+ // replaced by VTextArea so cannot replace this with TextArea.
+ messages = new TextField("Messages");
+ messages.setRows(10);
+ messages.setColumns(40);
+ messages.setVisible(false);
+ messages.setEnabled(false);
+ addComponent(messages);
+ }
+
+ public final void buttonClick(Button.ClickEvent e) {
+ if (e.getButton() == control) {
+ messages.setVisible(control.booleanValue());
+ }
+ }
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Check or uncheck the CheckBox to show/hide the messages field inside the FormLayout.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 6308;
+ }
+
+} \ No newline at end of file