*/
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
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();
+ }
}