diff options
author | Artur Signell <artur.signell@itmill.com> | 2011-01-20 11:03:04 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2011-01-20 11:03:04 +0000 |
commit | 59364e03aae6a773cc35e8bda068820f58b433b6 (patch) | |
tree | de72cd8b85c2cdf2b17a22fc47471c975b4aac5a | |
parent | 5b87502e7518eb9e5c933a60e9dc27dc5e4dac0b (diff) | |
download | vaadin-framework-59364e03aae6a773cc35e8bda068820f58b433b6.tar.gz vaadin-framework-59364e03aae6a773cc35e8bda068820f58b433b6.zip |
Test for #6308
svn changeset:16961/svn branch:6.5
-rw-r--r-- | tests/src/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.html | 42 | ||||
-rw-r--r-- | tests/src/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java | 57 |
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 |