aboutsummaryrefslogtreecommitdiffstats
path: root/test/servlet-containers
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-05-02 15:28:57 +0300
committerGitHub <noreply@github.com>2018-05-02 15:28:57 +0300
commitd59b821bc74569f962f93c9026e3c0088ee4b9e9 (patch)
tree40d5fc71af064bbc45b6f7b73c738f0186f5b898 /test/servlet-containers
parente65e9c5821cdab4d3042a0df8e1fd06c7f36de9a (diff)
downloadvaadin-framework-d59b821bc74569f962f93c9026e3c0088ee4b9e9.tar.gz
vaadin-framework-d59b821bc74569f962f93c9026e3c0088ee4b9e9.zip
Add test to verify proper init of websockets (#10865)
Diffstat (limited to 'test/servlet-containers')
-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();
+ }
}