summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/extensions/ResponsiveUITest.java
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src/com/vaadin/tests/extensions/ResponsiveUITest.java')
-rw-r--r--uitest/src/com/vaadin/tests/extensions/ResponsiveUITest.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/extensions/ResponsiveUITest.java b/uitest/src/com/vaadin/tests/extensions/ResponsiveUITest.java
index 76babed333..9b86350ebc 100644
--- a/uitest/src/com/vaadin/tests/extensions/ResponsiveUITest.java
+++ b/uitest/src/com/vaadin/tests/extensions/ResponsiveUITest.java
@@ -22,6 +22,8 @@ import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
import com.vaadin.testbench.By;
import com.vaadin.tests.tb3.MultiBrowserTest;
@@ -44,6 +46,11 @@ public class ResponsiveUITest extends MultiBrowserTest {
public void testResizingSplitPanelReflowsLayout() throws Exception {
openTestURL();
+ // IE sometimes has trouble waiting long enough.
+ new WebDriverWait(getDriver(), 30).until(ExpectedConditions
+ .presenceOfElementLocated(By
+ .cssSelector(".v-csslayout-grid.first")));
+
assertEquals("401px-600px",
$(".v-csslayout-grid.first").getAttribute("width-range"));
assertEquals("501px-",
@@ -75,4 +82,28 @@ public class ResponsiveUITest extends MultiBrowserTest {
new Actions(getDriver()).clickAndHold($(".v-splitpanel-hsplitter"))
.moveByOffset(xOffset, 0).release().build().perform();
}
+
+ @Test
+ public void testResizingWindowReflowsLayout() throws Exception {
+ openTestURL();
+
+ assertEquals("401px-600px",
+ $(".v-csslayout-grid.first").getAttribute("width-range"));
+ assertEquals("501px-",
+ $(".v-csslayout-grid.second").getAttribute("width-range"));
+
+ testBench().resizeViewPortTo(1224, 768);
+
+ assertEquals("601-800",
+ $(".v-csslayout-grid.first").getAttribute("width-range"));
+ assertEquals("501px-",
+ $(".v-csslayout-grid.second").getAttribute("width-range"));
+
+ testBench().resizeViewPortTo(674, 768);
+
+ assertEquals("201px-400px",
+ $(".v-csslayout-grid.first").getAttribute("width-range"));
+ assertEquals("301px-400px",
+ $(".v-csslayout-grid.second").getAttribute("width-range"));
+ }
}