You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PushConfigurationWebSocketTest.java 1.0KB

12345678910111213141516171819202122232425262728
  1. package com.vaadin.tests.push;
  2. import static org.hamcrest.CoreMatchers.containsString;
  3. import static org.hamcrest.CoreMatchers.not;
  4. import static org.hamcrest.MatcherAssert.assertThat;
  5. import org.junit.Test;
  6. public class PushConfigurationWebSocketTest extends PushConfigurationTest {
  7. @Test
  8. public void testWebsocket() throws InterruptedException {
  9. getTransportSelect().selectByText("Websocket");
  10. getPushModeSelect().selectByText("Automatic");
  11. assertThat(getStatusText(),
  12. containsString("fallbackTransport: long-polling"));
  13. assertThat(getStatusText(), containsString("transport: websocket"));
  14. waitForServerCounterToUpdate();
  15. // Use debug console to verify we used the correct transport type
  16. assertThat(driver.getPageSource(),
  17. containsString("Push connection established using websocket"));
  18. assertThat(driver.getPageSource(), not(
  19. containsString("Push connection established using streaming")));
  20. }
  21. }