]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix PushConfigurationStreamingTest for IE.
authorSauli Tähkäpää <sauli@vaadin.com>
Fri, 27 Jun 2014 07:34:42 +0000 (10:34 +0300)
committerSauli Tähkäpää <sauli@vaadin.com>
Fri, 27 Jun 2014 10:35:15 +0000 (13:35 +0300)
Change-Id: Iac342bdca90794a02c5966231142a585e2eeb216

uitest/src/com/vaadin/tests/push/PushConfigurationStreamingTest.java
uitest/src/com/vaadin/tests/push/ReconnectTest.java
uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java

index 8dc960c9ac27a4e33c08ce51525cf7b5fe2e4975..0861e618a2ed61163f127c0503d9443e096021ce 100644 (file)
@@ -27,33 +27,19 @@ import org.openqa.selenium.support.ui.Select;
 
 public class PushConfigurationStreamingTest extends PushConfigurationTest {
 
-    @Override
-    public List<DesiredCapabilities> getBrowsersToTest() {
-        List<DesiredCapabilities> browsers = super.getBrowsersToTest();
-
-        browsers.remove(Browser.IE8.getDesiredCapabilities());
-
-        return browsers;
-    }
-
     @Test
     public void testStreaming() throws InterruptedException {
         openDebugLogTab();
 
         new Select(getTransportSelect()).selectByVisibleText("STREAMING");
-        new Select(getPushModeSelect()).selectByVisibleText("AUTOMATIC");
-
         assertThat(getStatusText(),
                 containsString("fallbackTransport: long-polling"));
         assertThat(getStatusText(), containsString("transport: streaming"));
 
-        waitForServerCounterToUpdate();
+        clearDebugMessages();
+        new Select(getPushModeSelect()).selectByVisibleText("AUTOMATIC");
 
-        // Use debug console to verify we used the correct transport type
-        assertThat(
-                driver.getPageSource(),
-                not(containsString("Push connection established using websocket")));
-        assertThat(driver.getPageSource(),
-                containsString("Push connection established using streaming"));
+        waitForDebugMessage("Push connection established using streaming", 10);
+        waitForServerCounterToUpdate();
     }
 }
index 5ad2e7a1273d41b94ae2f936c97222bc39ef1e8c..6a632f266738770fe362ef38b05ac2bc2db159f2 100644 (file)
@@ -83,32 +83,6 @@ public abstract class ReconnectTest extends MultiBrowserTestWithProxy {
         waitForDebugMessage("Reopening push connection");
     }
 
-    private void clearDebugMessages() {
-        driver.findElement(
-                By.xpath("//button[@class='v-debugwindow-button' and @title='Clear log']"))
-                .click();
-    }
-
-    private boolean hasDebugMessage(String message) {
-        return getDebugMessage(message) != null;
-    }
-
-    private WebElement getDebugMessage(String message) {
-        return driver.findElement(By.xpath(String.format(
-                "//span[@class='v-debugwindow-message' and text()='%s']",
-                message)));
-    }
-
-    private void waitForDebugMessage(final String expectedMessage) {
-        waitUntil(new ExpectedCondition<Boolean>() {
-
-            @Override
-            public Boolean apply(WebDriver input) {
-                return hasDebugMessage(expectedMessage);
-            }
-        }, 30);
-    }
-
     private void connectAndVerifyConnectionEstablished() throws JSchException {
         connectProxy();
         waitUntilServerCounterChanges();
index 14be226de6e67db349f2246e099bb0c165433997..e5cceca6b881c9117a91a61970275449db474a5c 100644 (file)
@@ -165,6 +165,36 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
         return ((Locatable) element.getWrappedElement()).getCoordinates();
     }
 
+    private boolean hasDebugMessage(String message) {
+        return getDebugMessage(message) != null;
+    }
+
+    private WebElement getDebugMessage(String message) {
+        return driver.findElement(By.xpath(String.format(
+                "//span[@class='v-debugwindow-message' and text()='%s']",
+                message)));
+    }
+
+    protected void waitForDebugMessage(final String expectedMessage) {
+        waitForDebugMessage(expectedMessage, 30);
+    }
+
+    protected void waitForDebugMessage(final String expectedMessage, int timeout) {
+        waitUntil(new ExpectedCondition<Boolean>() {
+
+            @Override
+            public Boolean apply(WebDriver input) {
+                return hasDebugMessage(expectedMessage);
+            }
+        }, timeout);
+    }
+
+    protected void clearDebugMessages() {
+        driver.findElement(
+                By.xpath("//button[@class='v-debugwindow-button' and @title='Clear log']"))
+                .click();
+    }
+
     @Retention(RetentionPolicy.RUNTIME)
     @Target(ElementType.TYPE)
     public @interface RunLocally {