From 767495be230e7c300861a05e98a3a8505db88e10 Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Mon, 4 Feb 2013 15:02:20 +0200 Subject: [PATCH] Merge of (#10776) test to Vaadin 7. Change-Id: I05d66505ecc9d413ae34c0ae5e2fa735764d4fee --- .../RichTextAreaPreventsTextFieldAccess.html | 62 ++++++++++ .../RichTextAreaPreventsTextFieldAccess.java | 113 ++++++++++++++++++ 2 files changed, 175 insertions(+) create mode 100644 uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaPreventsTextFieldAccess.html create mode 100644 uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaPreventsTextFieldAccess.java 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 @@ + + + + + + +RichTextAreaPreventsTextFieldAccess + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RichTextAreaPreventsTextFieldAccess
open/run/com.vaadin.tests.components.richtextarea.RichTextAreaPreventsTextFieldAccess
mouseClickvaadin=runcomvaadintestscomponentsrichtextareaRichTextAreaPreventsTextFieldAccess::PID_Sfield127,13
typevaadin=runcomvaadintestscomponentsrichtextareaRichTextAreaPreventsTextFieldAccess::PID_Sfieldaaa
clickvaadin=runcomvaadintestscomponentsrichtextareaRichTextAreaPreventsTextFieldAccess::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]
clickvaadin=runcomvaadintestscomponentsrichtextareaRichTextAreaPreventsTextFieldAccess::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]
mouseClickvaadin=runcomvaadintestscomponentsrichtextareaRichTextAreaPreventsTextFieldAccess::PID_Sfield99,9
typevaadin=runcomvaadintestscomponentsrichtextareaRichTextAreaPreventsTextFieldAccess::PID_Sfieldaaabbb
mouseClickvaadin=runcomvaadintestscomponentsrichtextareaRichTextAreaPreventsTextFieldAccess::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/domChild[2]284,6
verifyValuevaadin=runcomvaadintestscomponentsrichtextareaRichTextAreaPreventsTextFieldAccess::PID_Sfieldaaabbb
+ + 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. " + + "
Step 1: Click on the 'Open RichTextArea-Dialog' button " + + "
Step 2: Write something in the RichTextArea. " + + "Do not press outside the textfield for the " + + "richTextArea.
Step 3: Press the 'removeWindowButton' " + + "
Now you cannot write in the TextField on this page " + + "
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; + } + +} -- 2.39.5