summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-05-02 15:28:57 +0300
committerIlia Motornyi <elmot@vaadin.com>2018-05-02 16:19:02 +0300
commit76297f2d6a664cf5daaaa9ef91a9db106d9df010 (patch)
tree17b361380299d683db7f227daa6fd5c8653a852f /test
parent236182bc8cc5121b8332ae2994996533ab8fcd78 (diff)
downloadvaadin-framework-76297f2d6a664cf5daaaa9ef91a9db106d9df010.tar.gz
vaadin-framework-76297f2d6a664cf5daaaa9ef91a9db106d9df010.zip
Add test to verify proper init of websockets (#10865)
Diffstat (limited to 'test')
-rw-r--r--test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java
index d1aa26e351..3a722768e4 100644
--- a/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java
+++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java
@@ -15,6 +15,14 @@
*/
package com.vaadin.tests.integration.websocket;
+import static org.junit.Assert.assertEquals;
+
+import java.util.stream.Stream;
+
+import org.junit.Test;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.By;
import com.vaadin.tests.integration.AbstractServletIntegrationTest;
public class ServletIntegrationWebsocketIT
@@ -25,4 +33,27 @@ public class ServletIntegrationWebsocketIT
protected String getTestPath() {
return "/run/ServletIntegrationWebsocketUI";
}
+
+ @Test
+ public void testWebsockedUsed() {
+ // Make sure the correct debug window tab is open.
+ findElements(By.className("v-debugwindow-tab")).get(1).click();
+
+ try {
+ // Wait to make sure correct tab is shown.
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ }
+
+ WebElement row = findElements(By.className("v-debugwindow-row")).get(7);
+ assertEquals("Communication method",
+ row.findElement(By.className("caption")).getText());
+ assertEquals("Client to server: websocket, server to client: websocket",
+ row.findElement(By.className("value")).getText());
+ }
+
+ protected Stream<String> getParameters() {
+ return Stream.concat(super.getParameters(), Stream.of("debug"))
+ .distinct();
+ }
}