aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-09-13 09:18:47 +0300
committerVaadin Code Review <review@vaadin.com>2013-10-16 11:48:05 +0000
commitf40159533028f28a1fe967daad4089fb3a35c53b (patch)
treee5c07f02ec0b37637ea670de80b4a05a25810ee7 /uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java
parent6155d61cda45c1b0370ead08a0d3c97539590059 (diff)
downloadvaadin-framework-f40159533028f28a1fe967daad4089fb3a35c53b.tar.gz
vaadin-framework-f40159533028f28a1fe967daad4089fb3a35c53b.zip
Test for pushing large chunks of data (#12567)
Change-Id: I846b8417f69a0dca7cda2c3851148896d22cabcc
Diffstat (limited to 'uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java')
-rw-r--r--uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java56
1 files changed, 56 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java b/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java
new file mode 100644
index 0000000000..83f9efc8dd
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.push;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+
+import com.vaadin.tests.tb3.WebsocketTest;
+
+public class PushLargeDataWebsocketTest extends WebsocketTest {
+
+ @Test
+ public void testWebsocketLargeData() {
+ openTestURL();
+
+ // Without this timing will be completly off as pushing "start" can
+ // remain waiting for all pushes to complete
+ testBench(driver).disableWaitForVaadin();
+
+ push();
+ // Push complete. Browser will reconnect now as > 10MB has been sent
+ // Push again to ensure push still works
+ push();
+
+ }
+
+ private void push() {
+ String logRow0Id = "Log_row_0";
+ By logRow0 = vaadinLocatorById(logRow0Id);
+
+ testBench(driver).waitForVaadin();
+ vaadinElementById("startButton").click();
+ waitUntil(ExpectedConditions.not(ExpectedConditions
+ .textToBePresentInElement(logRow0, "Push complete")));
+
+ // Pushes each 2000ms for 40s
+ sleep(40000);
+
+ waitUntil(ExpectedConditions.textToBePresentInElement(logRow0,
+ "Push complete"));
+ }
+}