aboutsummaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-08-09 11:27:14 +0300
committerHenri Sara <henri.sara@gmail.com>2017-08-09 11:27:14 +0300
commit69fb1c9895298da6f45cc00763515944aeb9c22d (patch)
treeb2f6e25aaf411d50dc1d1f02ca9f7cebd53f668d /uitest
parent40547e6914cd62ba6a718c00a2117451bf25c36d (diff)
downloadvaadin-framework-69fb1c9895298da6f45cc00763515944aeb9c22d.tar.gz
vaadin-framework-69fb1c9895298da6f45cc00763515944aeb9c22d.zip
Implement SimpleManagedLayout for CompositeConnector (#9791)
Fixes #9788
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/tree/TreeOnBrowserResize.java24
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/tree/TreeOnBrowserResizeTest.java41
2 files changed, 65 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/tree/TreeOnBrowserResize.java b/uitest/src/main/java/com/vaadin/tests/components/tree/TreeOnBrowserResize.java
new file mode 100644
index 0000000000..aa55336d13
--- /dev/null
+++ b/uitest/src/main/java/com/vaadin/tests/components/tree/TreeOnBrowserResize.java
@@ -0,0 +1,24 @@
+package com.vaadin.tests.components.tree;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Tree;
+
+@Widgetset("com.vaadin.DefaultWidgetSet")
+public class TreeOnBrowserResize extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Tree<String> tree = new Tree<>();
+ tree.setItems(
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
+ + "Ut a ante congue, dictum elit vitae, mollis justo. "
+ + "Nunc porttitor, eros et eleifend accumsan, quam dolor venenatis tortor, "
+ + "in euismod lorem massa quis nisi. In pretium viverra tincidunt. ");
+
+ tree.setSizeFull();
+ addComponent(tree);
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/tree/TreeOnBrowserResizeTest.java b/uitest/src/test/java/com/vaadin/tests/components/tree/TreeOnBrowserResizeTest.java
new file mode 100644
index 0000000000..153f389850
--- /dev/null
+++ b/uitest/src/test/java/com/vaadin/tests/components/tree/TreeOnBrowserResizeTest.java
@@ -0,0 +1,41 @@
+package com.vaadin.tests.components.tree;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.Dimension;
+
+import com.vaadin.testbench.elements.TreeGridElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class TreeOnBrowserResizeTest extends MultiBrowserTest {
+
+ @Test
+ public void testTreeSizeOnBrowserShrink() {
+ openTestURL();
+
+ int originalWidth = $(TreeGridElement.class).first().getTableWrapper()
+ .getSize().getWidth();
+
+ getDriver().manage().window().setSize(new Dimension(600, 800));
+
+ Assert.assertTrue("Tree size should decrease.",
+ originalWidth > $(TreeGridElement.class).first()
+ .getTableWrapper().getSize().getWidth());
+ }
+
+ @Test
+ public void testTreeSizeOnBrowserEnlarge() {
+ getDriver().manage().window().setSize(new Dimension(600, 800));
+ openTestURL();
+
+ int originalWidth = $(TreeGridElement.class).first().getTableWrapper()
+ .getSize().getWidth();
+
+ getDriver().manage().window().setSize(new Dimension(800, 800));
+
+ Assert.assertTrue("Tree size should increase.",
+ originalWidth < $(TreeGridElement.class).first()
+ .getTableWrapper().getSize().getWidth());
+ }
+
+}