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.

PollListeningTest.java 873B

1234567891011121314151617181920212223242526272829303132
  1. package com.vaadin.tests.components.ui;
  2. import org.junit.Test;
  3. import org.openqa.selenium.WebDriver;
  4. import org.openqa.selenium.support.ui.ExpectedCondition;
  5. import com.vaadin.tests.tb3.MultiBrowserTest;
  6. public class PollListeningTest extends MultiBrowserTest {
  7. @Test
  8. public void testReceivePollEvent() {
  9. openTestURL();
  10. waitUntilPollEventReceived();
  11. }
  12. private void waitUntilPollEventReceived() {
  13. waitUntil(new ExpectedCondition<Boolean>() {
  14. private String expected = "PollEvent received";
  15. @Override
  16. public Boolean apply(WebDriver arg0) {
  17. return driver.getPageSource().contains(expected);
  18. }
  19. @Override
  20. public String toString() {
  21. return String.format("page to contain text '%s'", expected);
  22. }
  23. });
  24. }
  25. }