summaryrefslogtreecommitdiffstats
path: root/uitest/src/test/java/com/vaadin/tests
diff options
context:
space:
mode:
authorAnna Koskinen <Ansku@users.noreply.github.com>2019-10-23 14:24:19 +0300
committerTatu Lund <tatu@vaadin.com>2019-10-23 14:24:19 +0300
commitf1dc01ec76840d995d562ba04d6ef6553c19b749 (patch)
treede091138fd0759473ca8a9a0ee43b94944318de3 /uitest/src/test/java/com/vaadin/tests
parent3980e35b71f9f20bf812123de8f017398927ff46 (diff)
downloadvaadin-framework-f1dc01ec76840d995d562ba04d6ef6553c19b749.tar.gz
vaadin-framework-f1dc01ec76840d995d562ba04d6ef6553c19b749.zip
When ComboBox popup opens to the left accommodate margin/border/padding. (#11755)
Fixes #11718
Diffstat (limited to 'uitest/src/test/java/com/vaadin/tests')
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxAtRightEdgeTest.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxAtRightEdgeTest.java b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxAtRightEdgeTest.java
new file mode 100644
index 0000000000..e65d4ed12b
--- /dev/null
+++ b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxAtRightEdgeTest.java
@@ -0,0 +1,27 @@
+package com.vaadin.tests.components.combobox;
+
+import org.junit.Test;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.elements.ComboBoxElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class ComboBoxAtRightEdgeTest extends MultiBrowserTest {
+
+ @Test
+ public void ensurePopupInView() {
+ openTestURL();
+
+ ComboBoxElement cb = $(ComboBoxElement.class).first();
+ cb.openPopup();
+ WebElement popup = cb.getSuggestionPopup();
+
+ int cbRight = cb.getLocation().getX() + cb.getSize().getWidth();
+ int popupRight = popup.getLocation().getX()
+ + popup.getSize().getWidth();
+ assertGreaterOrEqual(String.format(
+ "Popup should not reach further right than the ComboBox at the "
+ + "right edge of the viewport. ComboBox: %s, Popup: %s",
+ cbRight, popupRight), cbRight, popupRight);
+ }
+}