diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2013-02-05 14:39:35 +0000 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-02-05 14:39:35 +0000 |
commit | 1431139cb24af12edc6685a2841460a0d4dd03b9 (patch) | |
tree | 23cc964bdbd10427fce2a368e4202ec0e1e340bc /uitest | |
parent | 67c43d12cdc3295aa66b1e2e4b9ce3eb78e9a0e1 (diff) | |
parent | 767495be230e7c300861a05e98a3a8505db88e10 (diff) | |
download | vaadin-framework-1431139cb24af12edc6685a2841460a0d4dd03b9.tar.gz vaadin-framework-1431139cb24af12edc6685a2841460a0d4dd03b9.zip |
Merge "Merge of (#10776) test to Vaadin 7." into 7.0
Diffstat (limited to 'uitest')
2 files changed, 175 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaPreventsTextFieldAccess.html b/uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaPreventsTextFieldAccess.html new file mode 100644 index 0000000000..6601bf9d88 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaPreventsTextFieldAccess.html @@ -0,0 +1,62 @@ +<?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>RichTextAreaPreventsTextFieldAccess</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">RichTextAreaPreventsTextFieldAccess</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.richtextarea.RichTextAreaPreventsTextFieldAccess</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsrichtextareaRichTextAreaPreventsTextFieldAccess::PID_Sfield</td> + <td>127,13</td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentsrichtextareaRichTextAreaPreventsTextFieldAccess::PID_Sfield</td> + <td>aaa</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsrichtextareaRichTextAreaPreventsTextFieldAccess::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsrichtextareaRichTextAreaPreventsTextFieldAccess::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsrichtextareaRichTextAreaPreventsTextFieldAccess::PID_Sfield</td> + <td>99,9</td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentsrichtextareaRichTextAreaPreventsTextFieldAccess::PID_Sfield</td> + <td>aaabbb</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsrichtextareaRichTextAreaPreventsTextFieldAccess::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/domChild[2]</td> + <td>284,6</td> +</tr> +<tr> + <td>verifyValue</td> + <td>vaadin=runcomvaadintestscomponentsrichtextareaRichTextAreaPreventsTextFieldAccess::PID_Sfield</td> + <td>aaabbb</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaPreventsTextFieldAccess.java b/uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaPreventsTextFieldAccess.java new file mode 100644 index 0000000000..f4ad149dd1 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaPreventsTextFieldAccess.java @@ -0,0 +1,113 @@ +package com.vaadin.tests.components.richtextarea; + +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.shared.ui.label.ContentMode; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.CheckBox; +import com.vaadin.ui.Label; +import com.vaadin.ui.RichTextArea; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; +import com.vaadin.ui.Window; + +public class RichTextAreaPreventsTextFieldAccess extends TestBase { + + @Override + protected void setup() { + Label label = new Label( + "Steps to reproduce problem with IE8. " + + "<br> Step 1: Click on the 'Open RichTextArea-Dialog' button " + + "<br> Step 2: Write something in the RichTextArea. " + + "Do not press outside the textfield for the " + + "richTextArea. <br> Step 3: Press the 'removeWindowButton' " + + "<br> Now you cannot write in the TextField on this page " + + "<br> Resetting the focus to textfield explicitly, works around the issue"); + label.setContentMode(ContentMode.HTML); + addComponent(label); + + final TextField testField = new TextField(""); + testField.setId("field"); + addComponent(testField); + + final RichTextArea rText = new RichTextArea(); + rText.setWidth("300px"); + rText.setHeight("300px"); + + final Window subWindow = new Window("SubWindow"); + subWindow.setWidth("500px"); + subWindow.setHeight("500px"); + subWindow.setModal(true); + + final VerticalLayout wLayout = new VerticalLayout(); + subWindow.setContent(wLayout); + + wLayout.addComponent(rText); + wLayout.addComponent(new TextField()); + + Button addWindowButton = new Button("Open RichTextArea-Dialog"); + addWindowButton.addClickListener(new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + getMainWindow().addWindow(subWindow); + + } + }); + addComponent(addWindowButton); + + Button removeWindowButton = new Button("removeWindowButton"); + removeWindowButton.addClickListener(new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + getMainWindow().removeWindow(subWindow); + + } + }); + wLayout.addComponent(removeWindowButton); + + Button focusButton = new Button("Set focus on TextField"); + focusButton.addClickListener(new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + testField.focus(); + + } + }); + addComponent(focusButton); + + Button removeRTA = new Button("Remove RTA"); + removeRTA.addClickListener(new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + wLayout.removeComponent(rText); + + } + }); + wLayout.addComponent(removeRTA); + + CheckBox cb = new CheckBox("close"); + cb.setImmediate(true); + cb.addValueChangeListener(new ValueChangeListener() { + + @Override + public void valueChange(ValueChangeEvent event) { + getMainWindow().removeWindow(subWindow); + } + }); + wLayout.addComponent(cb); + + } + + @Override + protected String getDescription() { + return "RichtextArea prevents TextField access in IE8"; + } + + @Override + protected Integer getTicketNumber() { + return 10776; + } + +} |