summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorMika Murtojarvi <mika@vaadin.com>2013-10-29 15:22:45 +0200
committerVaadin Code Review <review@vaadin.com>2013-10-30 13:39:05 +0000
commit017bd0684c7d6c8475c8b43514e6f3998095c8d6 (patch)
treef421a4ae7e4b10e7339f6f1acc56b66aa0f0b15a /uitest
parent878c2bd4643c9cf08fb0ed2da8bae7f7a626ce8b (diff)
downloadvaadin-framework-017bd0684c7d6c8475c8b43514e6f3998095c8d6.tar.gz
vaadin-framework-017bd0684c7d6c8475c8b43514e6f3998095c8d6.zip
Fixes the handling of the scroll position of a Window (#12736)
After the first commit the same fix has been applied also for panels, in addition to other suggested changes. The scroll position of a Window is now memorized before applying the fix for bug #11994. The position is restored after the fix. Because the scrolling issue is known to appear also in other components, the fix for the scrolling has been moved to the Util class. Change-Id: I5251011b5bede77a7fb18972e1d90016c0eccc23
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindow.java66
-rw-r--r--uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java57
2 files changed, 123 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindow.java b/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindow.java
new file mode 100644
index 0000000000..6347ff9a76
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindow.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.window;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+
+/**
+ *
+ * @since
+ * @author Vaadin Ltd
+ */
+public class ComboboxScrollableWindow extends AbstractTestUI {
+
+ static final String WINDOW_ID = "window";
+ static final String COMBOBOX_ID = "combobox";
+
+ @Override
+ protected void setup(VaadinRequest request) {
+
+ Window w = new Window();
+ w.setId(WINDOW_ID);
+ w.setWidth("300px");
+ w.setHeight("300px");
+ w.center();
+
+ VerticalLayout content = new VerticalLayout();
+ w.setContent(content);
+ content.setHeight("1000px");
+ ComboBox cb = new ComboBox();
+ cb.setId(COMBOBOX_ID);
+ content.addComponent(cb);
+ content.setComponentAlignment(cb, Alignment.BOTTOM_CENTER);
+
+ addWindow(w);
+
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "The combo box in the bottom of the scrollable window should remain visible when it is clicked.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 12736;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java b/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java
new file mode 100644
index 0000000000..665e175f2c
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.window;
+
+import static com.vaadin.tests.components.window.ComboboxScrollableWindow.COMBOBOX_ID;
+import static com.vaadin.tests.components.window.ComboboxScrollableWindow.WINDOW_ID;
+
+import org.junit.Test;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.By;
+import com.vaadin.testbench.commands.TestBenchElementCommands;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+/**
+ *
+ * @since
+ * @author Vaadin Ltd
+ */
+public class ComboboxScrollableWindowTest extends MultiBrowserTest {
+
+ @Test
+ public void testWindowScrollbars() throws Exception {
+ openTestURL();
+ com.vaadin.testbench.Parameters
+ .setScreenshotComparisonCursorDetection(true);
+
+ WebElement window = driver.findElement(By.id(WINDOW_ID));
+ WebElement scrollableElement = window.findElement(By
+ .className("v-scrollable"));
+ TestBenchElementCommands scrollable = testBenchElement(scrollableElement);
+ scrollable.scroll(1000);
+ WebElement comboBox = driver.findElement(By.id(COMBOBOX_ID));
+ WebElement selectButton = driver.findElement(By
+ .className("v-filterselect-button"));
+ selectButton.click();
+
+ // Wait for the browser before taking a screenshot
+ Thread.sleep(1000);
+ compareScreen(getScreenshotBaseName());
+
+ }
+
+}