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.

UISerializationTest.java 950B

12345678910111213141516171819202122232425262728293031
  1. package com.vaadin.tests.components.ui;
  2. import static org.hamcrest.Matchers.allOf;
  3. import static org.hamcrest.Matchers.containsString;
  4. import static org.hamcrest.Matchers.endsWith;
  5. import static org.hamcrest.Matchers.startsWith;
  6. import static org.junit.Assert.assertThat;
  7. import org.junit.Test;
  8. import com.vaadin.testbench.elements.ButtonElement;
  9. import com.vaadin.tests.tb3.SingleBrowserTest;
  10. public class UISerializationTest extends SingleBrowserTest {
  11. @Test
  12. public void uiIsSerialized() throws Exception {
  13. openTestURL();
  14. serialize();
  15. assertThat(getLogRow(0), startsWith("3. Diff states match, size: "));
  16. assertThat(getLogRow(1), startsWith("2. Deserialized UI in "));
  17. assertThat(getLogRow(2), allOf(startsWith("1. Serialized UI in"),
  18. containsString(" into "), endsWith(" bytes")));
  19. }
  20. private void serialize() {
  21. $(ButtonElement.class).first().click();
  22. }
  23. }