aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/test/java/com/vaadin/tests/components/richtextarea/RichTextAreaReadOnlyDisabledTest.java
blob: ebfbee95c47704c67626fdda17fb91407c8ccde5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.vaadin.tests.components.richtextarea;

import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

import com.vaadin.tests.tb3.MultiBrowserTest;

public class RichTextAreaReadOnlyDisabledTest extends MultiBrowserTest {

    @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"));
    }
}