summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2012-01-27 13:10:57 +0000
committerArtur Signell <artur.signell@itmill.com>2012-01-27 13:10:57 +0000
commit0f7bf07b0a332cc6b5cb698b5575358b46579670 (patch)
treeb6bc8f794d6d7815a2d767dceb6e5709d3c87069 /tests
parentf12551699493a191b4501bf10899a184f7f9f73a (diff)
downloadvaadin-framework-0f7bf07b0a332cc6b5cb698b5575358b46579670.tar.gz
vaadin-framework-0f7bf07b0a332cc6b5cb698b5575358b46579670.zip
#6902 Table empties field on Layout.replaceComponent
svn changeset:22788/svn branch:6.7
Diffstat (limited to 'tests')
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.html47
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java10
2 files changed, 54 insertions, 3 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.html b/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.html
new file mode 100644
index 0000000000..4573cf4c50
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.html
@@ -0,0 +1,47 @@
+<?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>TextFieldValueGoesMissing</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">TextFieldValueGoesMissing</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.table.TextFieldValueGoesMissing?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstableTextFieldValueGoesMissing::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td>
+ <td>73,10</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestscomponentstableTextFieldValueGoesMissing::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td>
+ <td>test</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentstableTextFieldValueGoesMissing::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>contextmenu</td>
+ <td>vaadin=runcomvaadintestscomponentstableTextFieldValueGoesMissing::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestscomponentstableTextFieldValueGoesMissing::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td>
+ <td>test</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java b/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java
index 254f1b0a90..f3ff5e983e 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java
@@ -17,11 +17,15 @@ public class TextFieldValueGoesMissing extends TestBase {
final Label label1 = new Label("1");
final Label label2 = new Label("2");
- Button button = new Button("Refresh");
+ Button button = new Button("Replace label");
button.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- verticalLayout.replaceComponent(label1, label2);
+ if (verticalLayout.getComponentIndex(label1) > -1) {
+ verticalLayout.replaceComponent(label1, label2);
+ } else {
+ verticalLayout.replaceComponent(label2, label1);
+ }
}
});
verticalLayout.addComponent(button);
@@ -41,7 +45,7 @@ public class TextFieldValueGoesMissing extends TestBase {
@Override
protected String getDescription() {
- return "Enter a text in the TextField in the table and press the 'replace label' button. This replaces the label which is in the same layout as the table but should not cause the TextField in the table to lose its contents";
+ return "Enter a text in the TextField in the table and press the 'Replace label' button. This replaces the label which is in the same layout as the table but should not cause the TextField in the table to lose its contents";
}
@Override