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.

SelectAllConstantViewportTest.java 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package com.vaadin.tests.components.table;
  2. import static org.hamcrest.CoreMatchers.is;
  3. import static org.hamcrest.MatcherAssert.assertThat;
  4. import java.io.IOException;
  5. import org.junit.Test;
  6. import org.openqa.selenium.WebElement;
  7. import com.vaadin.testbench.By;
  8. import com.vaadin.testbench.elements.CheckBoxElement;
  9. import com.vaadin.testbench.elements.TableElement;
  10. import com.vaadin.tests.tb3.MultiBrowserTest;
  11. public class SelectAllConstantViewportTest extends MultiBrowserTest {
  12. @Test
  13. public void testViewportUnchanged() throws IOException {
  14. openTestURL();
  15. CheckBoxElement checkbox = $(CheckBoxElement.class).first();
  16. WebElement row = $(TableElement.class).first().getCell(190, 0);
  17. final WebElement scrollPositionDisplay = getDriver()
  18. .findElement(By.className("v-table-scrollposition"));
  19. waitUntilNot(input -> scrollPositionDisplay.isDisplayed(), 10);
  20. int rowLocation = row.getLocation().getY();
  21. // use click x,y with non-zero offset to actually toggle the checkbox.
  22. // (#13763)
  23. checkbox.click(5, 5);
  24. int newRowLocation = row.getLocation().getY();
  25. assertThat(newRowLocation, is(rowLocation));
  26. }
  27. }