summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersTest.java
blob: 95c03d99597f6bfbd29afd32fa9bc44f21063a57 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.vaadin.tests.push;

import org.junit.Test;

import com.vaadin.testbench.By;
import com.vaadin.testbench.elements.TextAreaElement;
import com.vaadin.testbench.parallel.TestCategory;
import com.vaadin.tests.tb3.MultiBrowserTest;

@TestCategory("push")
public abstract class SendMultibyteCharactersTest extends MultiBrowserTest {

    @Override
    protected Class<?> getUIClass() {
        return SendMultibyteCharacters.class;
    }

    protected abstract String getTransport();

    @Test
    public void transportSupportsMultibyteCharacters() {
        setDebug(true);
        openTestURL("transport=" + getTransport());
        openDebugLogTab();

        TextAreaElement textArea = $(TextAreaElement.class).first();

        StringBuilder text = new StringBuilder();
        for (int i = 0; i < 20; i++) {
            text.append("之は日本語です、テストです。");
        }

        textArea.sendKeys(text.toString());

        clearDebugMessages();

        findElement(By.tagName("body")).click();

        waitForDebugMessage("RPC invocations to be sent to the server:", 5);
        waitForDebugMessage("Handling message from server", 10);
    }

}