You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ReindeerDateFieldPopupPositionTest.java 927B

12345678910111213141516171819202122232425262728293031
  1. package com.vaadin.tests.components.datefield;
  2. import static org.junit.Assert.assertTrue;
  3. import org.openqa.selenium.WebElement;
  4. import com.vaadin.testbench.elements.DateFieldElement;
  5. /**
  6. * Test for date field popup calendar position in reindeer theme.
  7. *
  8. * Test method is defined in super class.
  9. *
  10. * @author Vaadin Ltd
  11. */
  12. public class ReindeerDateFieldPopupPositionTest
  13. extends DateFieldPopupPositionTest {
  14. @Override
  15. protected void checkPopupPosition() {
  16. DateFieldElement field = $(DateFieldElement.class).first();
  17. int right = field.getLocation().getX() + field.getSize().getWidth();
  18. WebElement popup = getPopup();
  19. assertTrue(
  20. "Calendar popup has wrong X coordinate="
  21. + popup.getLocation().getX()
  22. + " , right side of the field is " + right,
  23. popup.getLocation().getX() >= right);
  24. }
  25. }