You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SystemMessagesTest.java 1.2KB

123456789101112131415161718192021222324252627282930313233343536
  1. package com.vaadin.tests.applicationservlet;
  2. import static org.junit.Assert.assertEquals;
  3. import org.junit.Test;
  4. import com.vaadin.testbench.elements.ButtonElement;
  5. import com.vaadin.testbench.elements.NativeSelectElement;
  6. import com.vaadin.testbench.elements.NotificationElement;
  7. import com.vaadin.tests.tb3.MultiBrowserTest;
  8. public class SystemMessagesTest extends MultiBrowserTest {
  9. @Test
  10. public void testFinnishLocaleInSystemErrorMessage() throws Exception {
  11. openTestURL();
  12. verifyError("fi_FI");
  13. }
  14. @Test
  15. public void testGermanLocaleInSystemErrorMessage() throws Exception {
  16. openTestURL();
  17. $(NativeSelectElement.class).first().selectByText("de_DE");
  18. verifyError("de_DE");
  19. }
  20. private void verifyError(String locale) {
  21. $(ButtonElement.class).first().click();
  22. NotificationElement notification = $(NotificationElement.class).first();
  23. assertEquals("Incorrect notification caption,",
  24. notification.getCaption(), "Internal error");
  25. assertEquals("Incorrect notification description,",
  26. notification.getDescription(),
  27. "MessagesInfo locale: " + locale);
  28. }
  29. }