aboutsummaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorAnastasia Smirnova <anasmi@utu.fi>2018-04-20 09:59:44 +0300
committerIlia Motornyi <elmot@vaadin.com>2018-04-20 09:59:44 +0300
commit3ffb27fa734195f103fdbfb5ad6c81d7a8b006f7 (patch)
tree18290c97503062b18defdbe5de29668c093c26f2 /uitest
parentd543e47becc77e5b18c69a416e6e84122ac10fe1 (diff)
downloadvaadin-framework-3ffb27fa734195f103fdbfb5ad6c81d7a8b006f7.tar.gz
vaadin-framework-3ffb27fa734195f103fdbfb5ad6c81d7a8b006f7.zip
Fix RichTextArea read-only+disabled
Resolves #10541
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaReadOnlyDisabled.java31
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/richtextarea/RichTextAreaReadOnlyDisabledTest.java37
2 files changed, 68 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaReadOnlyDisabled.java b/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaReadOnlyDisabled.java
new file mode 100644
index 0000000000..d9c8c22811
--- /dev/null
+++ b/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaReadOnlyDisabled.java
@@ -0,0 +1,31 @@
+package com.vaadin.tests.components.richtextarea;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.RichTextArea;
+
+public class RichTextAreaReadOnlyDisabled extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ RichTextArea readOnlyDisabledTextArea = new RichTextArea(
+ "Readonly & Disabled");
+ readOnlyDisabledTextArea.setReadOnly(true);
+ readOnlyDisabledTextArea.setEnabled(false);
+ readOnlyDisabledTextArea.setValue("Random value");
+ readOnlyDisabledTextArea.setId("rtA");
+
+ final Button but1 = new Button("set Read ",
+ event -> readOnlyDisabledTextArea
+ .setReadOnly(!readOnlyDisabledTextArea.isReadOnly()));
+ but1.setId("readPr");
+ final Button but2 = new Button("Enable/Disable ",
+ event -> readOnlyDisabledTextArea
+ .setEnabled(!readOnlyDisabledTextArea.isEnabled()));
+ but2.setId("enablePr");
+ addComponent(readOnlyDisabledTextArea);
+ addComponent(but1);
+ addComponent(but2);
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/richtextarea/RichTextAreaReadOnlyDisabledTest.java b/uitest/src/test/java/com/vaadin/tests/components/richtextarea/RichTextAreaReadOnlyDisabledTest.java
new file mode 100644
index 0000000000..83b1c41edc
--- /dev/null
+++ b/uitest/src/test/java/com/vaadin/tests/components/richtextarea/RichTextAreaReadOnlyDisabledTest.java
@@ -0,0 +1,37 @@
+package com.vaadin.tests.components.richtextarea;
+
+import com.vaadin.tests.tb3.MultiBrowserTest;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.remote.DesiredCapabilities;
+
+import java.util.List;
+
+public class RichTextAreaReadOnlyDisabledTest extends MultiBrowserTest {
+
+ @Override
+ public List<DesiredCapabilities> getBrowsersToTest() {
+ return getBrowsersExcludingPhantomJS();
+ }
+
+ @Test
+ public void shouldDelegateToShortcutActionHandler() {
+ openTestURL();
+ // gwt-RichTextArea is classname used by iframe
+ WebElement readPrB = findElement(By.id("readPr"));
+ WebElement enablePrB = findElement(By.id("enablePr"));
+
+ assertElementNotPresent(By.className("gwt-RichTextArea"));
+ readPrB.click();
+
+ assertElementNotPresent(By.className("gwt-RichTextArea"));
+ enablePrB.click();
+
+ assertElementPresent(By.className("gwt-RichTextArea"));
+ readPrB.click();//Set to read-only
+ assertElementNotPresent(By.className("gwt-RichTextArea"));
+ enablePrB.click();//Set disabled
+ assertElementNotPresent(By.className("gwt-RichTextArea"));
+ }
+}