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.

PushLargeDataWebsocketTest.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package com.vaadin.tests.push;
  2. import org.junit.Test;
  3. import org.openqa.selenium.By;
  4. import org.openqa.selenium.support.ui.ExpectedConditions;
  5. import com.vaadin.tests.tb3.WebsocketTest;
  6. public class PushLargeDataWebsocketTest extends WebsocketTest {
  7. @Test
  8. public void testWebsocketLargeData() throws Exception {
  9. openTestURL();
  10. // Without this timing will be completly off as pushing "start" can
  11. // remain waiting for all pushes to complete
  12. testBench(driver).disableWaitForVaadin();
  13. push();
  14. // Push complete. Browser will reconnect now as > 10MB has been sent
  15. // Push again to ensure push still works
  16. push();
  17. }
  18. private void push() throws Exception {
  19. // Wait for startButton to be present
  20. waitForElementVisible(vaadinLocatorById("startButton"));
  21. String logRow0Id = "Log_row_0";
  22. By logRow0 = vaadinLocatorById(logRow0Id);
  23. vaadinElementById("startButton").click();
  24. // Wait for push to start
  25. waitUntil(ExpectedConditions.textToBePresentInElement(logRow0,
  26. "Package"));
  27. // Wait for until push should be done
  28. sleep(PushLargeData.DEFAULT_DURATION_MS);
  29. // Wait until push is actually done
  30. waitUntil(ExpectedConditions.textToBePresentInElement(logRow0,
  31. "Push complete"));
  32. }
  33. }