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;
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());
}
}