Browse Source

Fix ComboboxScrollableWindowTest to use assertion (#11014)

tags/8.4.5^0
Teemu Suo-Anttila 5 years ago
parent
commit
37e42d097e

BIN
uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Chrome__combobox-open.png View File


BIN
uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_ANY_Firefox__combobox-open.png View File


BIN
uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_LINUX_PhantomJS_1_combobox-open.png View File


BIN
uitest/reference-screenshots/ComboboxScrollableWindowTest-testWindowScrollbars_Windows_InternetExplorer_11_combobox-open.png View File


+ 12
- 1
uitest/src/test/java/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java View 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());
}

}

Loading…
Cancel
Save