]> source.dussan.org Git - vaadin-framework.git/commitdiff
Converted serialization test to be run in validation builds
authorArtur Signell <artur@vaadin.com>
Wed, 6 Aug 2014 16:00:26 +0000 (19:00 +0300)
committerVaadin Code Review <review@vaadin.com>
Mon, 11 Aug 2014 19:21:41 +0000 (19:21 +0000)
Change-Id: Ia6f809349a8ee81bd2d150176c69c6d6ae10491f

uitest/src/com/vaadin/tests/components/ui/UISerialization.html [deleted file]
uitest/src/com/vaadin/tests/components/ui/UISerializationTest.java [new file with mode: 0644]

diff --git a/uitest/src/com/vaadin/tests/components/ui/UISerialization.html b/uitest/src/com/vaadin/tests/components/ui/UISerialization.html
deleted file mode 100644 (file)
index 2379882..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="http://localhost:8888/" />
-<title>New Test</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">New Test</td></tr>
-</thead><tbody>
-<tr>
-       <td>open</td>
-       <td>/run/com.vaadin.tests.components.ui.UISerialization?restartApplication</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>vaadin=runcomvaadintestscomponentsuiUISerialization::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]/domChild[0]</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertText</td>
-       <td>vaadin=runcomvaadintestscomponentsuiUISerialization::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]</td>
-       <td>3. Diff states match, size: *</td>
-</tr>
-<tr>
-       <td>assertText</td>
-       <td>vaadin=runcomvaadintestscomponentsuiUISerialization::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VLabel[0]</td>
-       <td>2. Deserialized UI in *ms</td>
-</tr>
-<tr>
-       <td>assertText</td>
-       <td>vaadin=runcomvaadintestscomponentsuiUISerialization::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VLabel[0]</td>
-       <td>1. Serialized UI in *ms into * bytes</td>
-</tr>
-</tbody></table>
-</body>
-</html>
diff --git a/uitest/src/com/vaadin/tests/components/ui/UISerializationTest.java b/uitest/src/com/vaadin/tests/components/ui/UISerializationTest.java
new file mode 100644 (file)
index 0000000..cbe4dbd
--- /dev/null
@@ -0,0 +1,26 @@
+package com.vaadin.tests.components.ui;
+
+import static org.hamcrest.Matchers.allOf;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.endsWith;
+import static org.hamcrest.Matchers.startsWith;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class UISerializationTest extends SingleBrowserTest {
+    @Test
+    public void tb2test() throws Exception {
+        openTestURL();
+        $(ButtonElement.class).first().click();
+        assertThat(getLogRow(0), startsWith("3. Diff states match, size: "));
+        assertThat(getLogRow(1), startsWith("2. Deserialized UI in "));
+        assertThat(
+                getLogRow(2),
+                allOf(startsWith("1. Serialized UI in"),
+                        containsString(" into "), endsWith(" bytes")));
+    }
+}