summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-06-29 12:18:45 +0300
committerIlia Motornyi <elmot@vaadin.com>2018-06-29 12:18:45 +0300
commit3389d896f74040308284648599512ddd5413f62c (patch)
tree09d6d47b81d14f99369dbba9e6f3d994e6ce418c
parent0b2e6a525206e466b7637c8f147c2eb5355dd8c3 (diff)
downloadvaadin-framework-3389d896f74040308284648599512ddd5413f62c.tar.gz
vaadin-framework-3389d896f74040308284648599512ddd5413f62c.zip
Fix ComboboxScrollableWindowTest to use assertion (#11014)
-rwxr-xr-xuitest/reference-screenshots/chrome/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Chrome__combobox-open.pngbin17551 -> 0 bytes
-rw-r--r--uitest/reference-screenshots/firefox/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Firefox__combobox-open.pngbin18081 -> 0 bytes
-rwxr-xr-xuitest/reference-screenshots/internetexplorer/ComboboxScrollableWindowTest-testWindowScrollbars_Windows_InternetExplorer_11_combobox-open.pngbin13777 -> 0 bytes
-rw-r--r--uitest/reference-screenshots/phantomjs/ComboboxScrollableWindowTest-testWindowScrollbars_LINUX_PhantomJS_1_combobox-open.pngbin15712 -> 0 bytes
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java13
5 files changed, 12 insertions, 1 deletions
diff --git a/uitest/reference-screenshots/chrome/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Chrome__combobox-open.png b/uitest/reference-screenshots/chrome/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Chrome__combobox-open.png
deleted file mode 100755
index 4e63fc1601..0000000000
--- a/uitest/reference-screenshots/chrome/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Chrome__combobox-open.png
+++ /dev/null
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Firefox__combobox-open.png b/uitest/reference-screenshots/firefox/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Firefox__combobox-open.png
deleted file mode 100644
index 4dd08c802e..0000000000
--- a/uitest/reference-screenshots/firefox/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Firefox__combobox-open.png
+++ /dev/null
Binary files differ
diff --git a/uitest/reference-screenshots/internetexplorer/ComboboxScrollableWindowTest-testWindowScrollbars_Windows_InternetExplorer_11_combobox-open.png b/uitest/reference-screenshots/internetexplorer/ComboboxScrollableWindowTest-testWindowScrollbars_Windows_InternetExplorer_11_combobox-open.png
deleted file mode 100755
index 599526228a..0000000000
--- a/uitest/reference-screenshots/internetexplorer/ComboboxScrollableWindowTest-testWindowScrollbars_Windows_InternetExplorer_11_combobox-open.png
+++ /dev/null
Binary files differ
diff --git a/uitest/reference-screenshots/phantomjs/ComboboxScrollableWindowTest-testWindowScrollbars_LINUX_PhantomJS_1_combobox-open.png b/uitest/reference-screenshots/phantomjs/ComboboxScrollableWindowTest-testWindowScrollbars_LINUX_PhantomJS_1_combobox-open.png
deleted file mode 100644
index 612af88ed5..0000000000
--- a/uitest/reference-screenshots/phantomjs/ComboboxScrollableWindowTest-testWindowScrollbars_LINUX_PhantomJS_1_combobox-open.png
+++ /dev/null
Binary files differ
diff --git a/uitest/src/test/java/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java b/uitest/src/test/java/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java
index c4cb78eeef..62a6925282 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java
@@ -2,8 +2,10 @@ 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 static org.junit.Assert.assertEquals;
import org.junit.Test;
+import org.openqa.selenium.Point;
import org.openqa.selenium.WebElement;
import com.vaadin.testbench.By;
@@ -29,11 +31,20 @@ public class ComboboxScrollableWindowTest extends MultiBrowserTest {
TestBenchElementCommands scrollable = testBenchElement(
scrollableElement);
scrollable.scroll(1000);
+
+ int beforeClick = getScrollTop(scrollableElement);
ComboBoxElement comboBox = $(ComboBoxElement.class).id(COMBOBOX_ID);
+ Point location = comboBox.getLocation();
+
comboBox.openPopup();
waitForElementPresent(By.className("v-filterselect-suggestpopup"));
- compareScreen("combobox-open");
+ assertEquals("Clicking should not cause scrolling", beforeClick,
+ getScrollTop(scrollableElement));
+ assertEquals("ComboBox should not move along x-axis", location.getX(),
+ comboBox.getLocation().getX());
+ assertEquals("ComboBox should not move along y-axis", location.getY(),
+ comboBox.getLocation().getY());
}
}