diff options
author | John Alhroos <john.ahlroos@itmill.com> | 2011-03-08 13:36:05 +0000 |
---|---|---|
committer | John Alhroos <john.ahlroos@itmill.com> | 2011-03-08 13:36:05 +0000 |
commit | b9c32e522b658146579a693a65a37fb77d17c181 (patch) | |
tree | c65e4426676b224a75d92cd817574547c69c45e3 /tests | |
parent | a355710da33d7456414aba6a33144ac348b46f5f (diff) | |
download | vaadin-framework-b9c32e522b658146579a693a65a37fb77d17c181.tar.gz vaadin-framework-b9c32e522b658146579a693a65a37fb77d17c181.zip |
Added testbench test for #6507
svn changeset:17672/svn branch:6.5
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.html | 48 | ||||
-rw-r--r-- | tests/src/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.java | 48 |
2 files changed, 96 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.html b/tests/src/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.html new file mode 100644 index 0000000000..544cea9faa --- /dev/null +++ b/tests/src/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.html @@ -0,0 +1,48 @@ +<?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="" /> +<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.textfield.TextChangeTimeoutAfterDetach?restartApplication</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextfieldTextChangeTimeoutAfterDetach::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextField[0]</td> + <td>119,12</td> +</tr> +<tr> + <td>enterCharacter</td> + <td>vaadin=runcomvaadintestscomponentstextfieldTextChangeTimeoutAfterDetach::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextField[0]</td> + <td>aaaa</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstextfieldTextChangeTimeoutAfterDetach::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<!--Wait for 3 seconds so the timeout occurs--> +<tr> + <td>pause</td> + <td>3000</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td></td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/src/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.java b/tests/src/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.java new file mode 100644 index 0000000000..d1f856f40c --- /dev/null +++ b/tests/src/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.java @@ -0,0 +1,48 @@ +package com.vaadin.tests.components.textfield; + +import com.vaadin.event.FieldEvents.TextChangeEvent; +import com.vaadin.event.FieldEvents.TextChangeListener; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.AbstractTextField.TextChangeEventMode; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Label; +import com.vaadin.ui.TextField; + +public class TextChangeTimeoutAfterDetach extends TestBase { + + @Override + protected void setup() { + final TextField field = new TextField(); + field.setImmediate(false); + field.setTextChangeTimeout(2000); + field.setTextChangeEventMode(TextChangeEventMode.TIMEOUT); + field.addListener(new TextChangeListener() { + public void textChange(TextChangeEvent event) { + // Need to add a listener for events to occur + } + }); + addComponent(field); + + Button detachBtn = new Button("detach field", + new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + removeComponent(field); + getLayout().addComponentAsFirst( + new Label("Field detached!")); + } + }); + addComponent(detachBtn); + } + + @Override + protected String getDescription() { + return "The textfield has a TextChangeTimout of 1 second. Edit the field and immidietly detach the field and you will cause an \"Out Of Sync\" error."; + } + + @Override + protected Integer getTicketNumber() { + return 6507; + } + +} |