aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/test/java/com/vaadin/tests/applicationservlet/SystemMessagesTest.java
blob: bd0920c56a00a818b2e9942e0b87fe24c9d832d4 (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
package com.vaadin.tests.applicationservlet;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.NativeSelectElement;
import com.vaadin.testbench.elements.NotificationElement;
import com.vaadin.tests.tb3.MultiBrowserTest;

public class SystemMessagesTest extends MultiBrowserTest {

    @Test
    public void testFinnishLocaleInSystemErrorMessage() throws Exception {
        openTestURL();
        verifyError("fi_FI");
    }

    @Test
    public void testGermanLocaleInSystemErrorMessage() throws Exception {
        openTestURL();
        $(NativeSelectElement.class).first().selectByText("de_DE");
        verifyError("de_DE");
    }

    private void verifyError(String locale) {
        $(ButtonElement.class).first().click();
        NotificationElement notification = $(NotificationElement.class).first();
        assertEquals("Incorrect notification caption,",
                notification.getCaption(), "Internal error");
        assertEquals("Incorrect notification description,",
                notification.getDescription(),
                "MessagesInfo locale: " + locale);
    }
}