From 37e42d097e8507b24a1edea2c97502971b98b68f Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Fri, 29 Jun 2018 12:18:45 +0300 Subject: Fix ComboboxScrollableWindowTest to use assertion (#11014) --- ...t-testWindowScrollbars_ANY_Chrome__combobox-open.png | Bin 17551 -> 0 bytes ...-testWindowScrollbars_ANY_Firefox__combobox-open.png | Bin 18081 -> 0 bytes ...WindowScrollbars_LINUX_PhantomJS_1_combobox-open.png | Bin 15712 -> 0 bytes ...llbars_Windows_InternetExplorer_11_combobox-open.png | Bin 13777 -> 0 bytes .../components/window/ComboboxScrollableWindowTest.java | 13 ++++++++++++- 5 files changed, 12 insertions(+), 1 deletion(-) delete mode 100755 uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Chrome__combobox-open.png delete mode 100644 uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Firefox__combobox-open.png delete mode 100644 uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_LINUX_PhantomJS_1_combobox-open.png delete mode 100755 uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_Windows_InternetExplorer_11_combobox-open.png diff --git a/uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Chrome__combobox-open.png b/uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Chrome__combobox-open.png deleted file mode 100755 index 4e63fc1601..0000000000 Binary files a/uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Chrome__combobox-open.png and /dev/null differ diff --git a/uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Firefox__combobox-open.png b/uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Firefox__combobox-open.png deleted file mode 100644 index 4dd08c802e..0000000000 Binary files a/uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Firefox__combobox-open.png and /dev/null differ diff --git a/uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_LINUX_PhantomJS_1_combobox-open.png b/uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_LINUX_PhantomJS_1_combobox-open.png deleted file mode 100644 index 612af88ed5..0000000000 Binary files a/uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_LINUX_PhantomJS_1_combobox-open.png and /dev/null differ diff --git a/uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_Windows_InternetExplorer_11_combobox-open.png b/uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_Windows_InternetExplorer_11_combobox-open.png deleted file mode 100755 index 599526228a..0000000000 Binary files a/uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_Windows_InternetExplorer_11_combobox-open.png and /dev/null 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()); } } -- cgit v1.2.3