]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix ComboboxScrollableWindowTest to use assertion (#11014)
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>
Fri, 29 Jun 2018 09:18:45 +0000 (12:18 +0300)
committerIlia Motornyi <elmot@vaadin.com>
Fri, 29 Jun 2018 09:18:45 +0000 (12:18 +0300)
uitest/reference-screenshots/chrome/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Chrome__combobox-open.png [deleted file]
uitest/reference-screenshots/firefox/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Firefox__combobox-open.png [deleted file]
uitest/reference-screenshots/internetexplorer/ComboboxScrollableWindowTest-testWindowScrollbars_Windows_InternetExplorer_11_combobox-open.png [deleted file]
uitest/reference-screenshots/phantomjs/ComboboxScrollableWindowTest-testWindowScrollbars_LINUX_PhantomJS_1_combobox-open.png [deleted file]
uitest/src/test/java/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java

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 (executable)
index 4e63fc1..0000000
Binary files a/uitest/reference-screenshots/chrome/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Chrome__combobox-open.png and /dev/null 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 (file)
index 4dd08c8..0000000
Binary files a/uitest/reference-screenshots/firefox/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Firefox__combobox-open.png and /dev/null 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 (executable)
index 5995262..0000000
Binary files a/uitest/reference-screenshots/internetexplorer/ComboboxScrollableWindowTest-testWindowScrollbars_Windows_InternetExplorer_11_combobox-open.png and /dev/null 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 (file)
index 612af88..0000000
Binary files a/uitest/reference-screenshots/phantomjs/ComboboxScrollableWindowTest-testWindowScrollbars_LINUX_PhantomJS_1_combobox-open.png and /dev/null differ
index c4cb78eeef6f9773a6a4a12ad7738d4b0c019ebb..62a6925282ef9dc487cdc423fbb03dd1f81acdc8 100644 (file)
@@ -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());
     }
 
 }